summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-10-30 01:34:35 +0000
committerDan Gohman <gohman@apple.com>2009-10-30 01:34:35 +0000
commitc83dc4b5064a37f5485692f53d4f789e4aef4b1d (patch)
treedf51de7de476f27f59f3be9fc72f36fab55d5c9c /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parentf7c4299312a81ed3db082d70269dcaaaebfaa0de (diff)
downloadbcm5719-llvm-c83dc4b5064a37f5485692f53d4f789e4aef4b1d.tar.gz
bcm5719-llvm-c83dc4b5064a37f5485692f53d4f789e4aef4b1d.zip
Add some comments.
llvm-svn: 85558
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 257b963f9b4..55e620e1094 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1642,9 +1642,15 @@ MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {
/// 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 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
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 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB) const {
O << '\n';
}
+ // Print some comments to accompany the label.
if (VerboseAsm) {
if (const BasicBlock *BB = MBB->getBasicBlock())
if (BB->hasName()) {
OpenPOWER on IntegriCloud