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';
}
/// 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);
}
if (const ConstantVector *V = dyn_cast<ConstantVector>(CV))
return EmitGlobalConstantVector(V, AddrSpace, *this);
+ // ConstantExpr case.
printDataDirective(CV->getType(), AddrSpace);
EmitConstantValueOnly(CV);
O << '\n';
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();
}
}
@G1 = global i32 4712, section "Address=412"
; CHECK: @G1.412..user_section.# IDATA 412
-; CHECK: @G1 dl 4712
+; CHECK: @G1
+; CHECK: dl 4712
@G2 = global i32 0, section "Address=412"
; CHECK: @G2.412..user_section.# UDATA 412
@G3 = addrspace(1) constant i32 4712, section "Address=412"
; CHECK: @G3.412..user_section.# ROMDATA 412
-; CHECK: @G3 rom_dl 4712
+; CHECK: @G3
+; CHECK: rom_dl 4712