summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-20 07:19:19 +0000
committerChris Lattner <sabre@nondot.org>2010-01-20 07:19:19 +0000
commit4c8b1824f0958db75bf24e358330bdd043f93f35 (patch)
tree7ca6748193a06c84fc2b3cce7c387a637c04ce08 /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parent03cb2a303562c1314fa658476b82a6cc6613f41e (diff)
downloadbcm5719-llvm-4c8b1824f0958db75bf24e358330bdd043f93f35.tar.gz
bcm5719-llvm-4c8b1824f0958db75bf24e358330bdd043f93f35.zip
emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1,
for tidiness. llvm-svn: 93992
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index f584787aded..bb0cb181909 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -700,9 +700,7 @@ void AsmPrinter::EOL() const {
void AsmPrinter::EOL(const Twine &Comment) const {
if (VerboseAsm && !Comment.isTriviallyEmpty()) {
O.PadToColumn(MAI->getCommentColumn());
- O << MAI->getCommentString()
- << ' '
- << Comment;
+ O << MAI->getCommentString() << ' ' << Comment;
}
O << '\n';
}
@@ -1212,7 +1210,7 @@ static void EmitGlobalConstantLargeInt(const ConstantInt *CI,
/// EmitGlobalConstant - Print a general LLVM constant to the .s file.
void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
- if (CV->isNullValue() || isa<UndefValue>(CV)) {
+ if (isa<ConstantAggregateZero>(CV) || isa<UndefValue>(CV)) {
uint64_t Size = TM.getTargetData()->getTypeAllocSize(CV->getType());
return OutStreamer.EmitZeros(Size, AddrSpace);
}
@@ -1250,6 +1248,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) {
if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
return EmitGlobalConstantVector(V, AddrSpace, *this);
+ // ConstantExpr case.
printDataDirective(CV->getType(), AddrSpace);
EmitConstantValueOnly(CV);
O << '\n';
@@ -1307,19 +1306,17 @@ void AsmPrinter::processDebugLoc(const MachineInstr *MI,
if (CurDLT.getScope().isNull())
return;
- if (BeforePrintingInsn) {
- if (CurDLT.getNode() != PrevDLT) {
- unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(),
- CurDLT.getColumnNumber(),
- CurDLT.getScope().getNode());
- printLabel(L);
- O << '\n';
- DW->BeginScope(MI, L);
- PrevDLT = CurDLT.getNode();
- }
- } else {
+ if (!BeforePrintingInsn) {
// After printing instruction
DW->EndScope(MI);
+ } else if (CurDLT.getNode() != PrevDLT) {
+ unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(),
+ CurDLT.getColumnNumber(),
+ CurDLT.getScope().getNode());
+ printLabel(L);
+ O << '\n';
+ DW->BeginScope(MI, L);
+ PrevDLT = CurDLT.getNode();
}
}
OpenPOWER on IntegriCloud