[llvm-commits] [llvm] r85558 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Dan Gohman
gohman at apple.com
Thu Oct 29 18:34:35 PDT 2009
Author: djg
Date: Thu Oct 29 20:34:35 2009
New Revision: 85558
URL: http://llvm.org/viewvc/llvm-project?rev=85558&view=rev
Log:
Add some comments.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=85558&r1=85557&r2=85558&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Oct 29 20:34:35 2009
@@ -1642,9 +1642,15 @@
/// MachineBasicBlock, an alignment (if present) and a comment describing
/// it if appropriate.
void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
+ // Emit an alignment directive for this block, if needed.
if (unsigned Align = MBB->getAlignment())
EmitAlignment(Log2_32(Align));
+ // If the block has its address taken, emit a special label to satisfy
+ // references to the block. This is done so that we don't need to
+ // remember the number of this label, and so that we can make
+ // forward references to labels without knowing what their numbers
+ // will be.
if (MBB->hasAddressTaken()) {
GetBlockAddressSymbol(MBB->getBasicBlock()->getParent(),
MBB->getBasicBlock())->print(O, MAI);
@@ -1656,6 +1662,7 @@
O << '\n';
}
+ // Print the main label for the block.
if (MBB->pred_empty() || MBB->isOnlyReachableByFallthrough()) {
if (VerboseAsm)
O << MAI->getCommentString() << " BB#" << MBB->getNumber() << ':';
@@ -1666,6 +1673,7 @@
O << '\n';
}
+ // Print some comments to accompany the label.
if (VerboseAsm) {
if (const BasicBlock *BB = MBB->getBasicBlock())
if (BB->hasName()) {
More information about the llvm-commits
mailing list