[llvm-commits] CVS: llvm/lib/Target/ARM/ARMAsmPrinter.cpp
Rafael Espindola
rafael.espindola at gmail.com
Thu Oct 19 06:30:56 PDT 2006
Changes in directory llvm/lib/Target/ARM:
ARMAsmPrinter.cpp updated: 1.24 -> 1.25
---
Log message:
print common symbols
---
Diffs of the changes: (+33 -17)
ARMAsmPrinter.cpp | 50 +++++++++++++++++++++++++++++++++-----------------
1 files changed, 33 insertions(+), 17 deletions(-)
Index: llvm/lib/Target/ARM/ARMAsmPrinter.cpp
diff -u llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.24 llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.25
--- llvm/lib/Target/ARM/ARMAsmPrinter.cpp:1.24 Tue Oct 17 13:04:52 2006
+++ llvm/lib/Target/ARM/ARMAsmPrinter.cpp Thu Oct 19 08:30:40 2006
@@ -278,26 +278,42 @@
unsigned Size = TD->getTypeSize(C->getType());
unsigned Align = TD->getTypeAlignment(C->getType());
- switch (I->getLinkage()) {
- default:
- assert(0 && "Unknown linkage type!");
- break;
- case GlobalValue::ExternalLinkage:
- O << "\t.globl " << name << "\n";
- break;
- case GlobalValue::InternalLinkage:
- break;
- }
+ if (C->isNullValue() &&
+ (I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
+ I->hasWeakLinkage())) {
+ SwitchToDataSection(".data", I);
+ if (I->hasInternalLinkage())
+ O << "\t.local " << name << "\n";
+
+ O << "\t.comm " << name << "," << TD->getTypeSize(C->getType())
+ << "," << (unsigned)TD->getTypeAlignment(C->getType());
+ O << "\t\t";
+ O << TAI->getCommentString() << " ";
+ WriteAsOperand(O, I, true, true, &M);
+ O << "\n";
+ } else {
+ switch (I->getLinkage()) {
+ default:
+ assert(0 && "Unknown linkage type!");
+ break;
+ case GlobalValue::ExternalLinkage:
+ O << "\t.globl " << name << "\n";
+ break;
+ case GlobalValue::InternalLinkage:
+ break;
+ }
- assert (!C->isNullValue());
- SwitchToDataSection(".data", I);
+ assert (!C->isNullValue());
+ SwitchToDataSection(".data", I);
- EmitAlignment(Align, I);
- O << "\t.type " << name << ", %object\n";
- O << "\t.size " << name << ", " << Size << "\n";
- O << name << ":\n";
- EmitGlobalConstant(C);
+ EmitAlignment(Align, I);
+ O << "\t.type " << name << ", %object\n";
+ O << "\t.size " << name << ", " << Size << "\n";
+ O << name << ":\n";
+ EmitGlobalConstant(C);
+ }
}
+
AsmPrinter::doFinalization(M);
return false; // success
}
More information about the llvm-commits
mailing list