<< CPI << ':';
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
- O << TAI->getCommentString() << ' ';
- WriteTypeSymbolic(O, CPE.getType(), 0);
+ O << TAI->getCommentString() << " constant ";
+ WriteTypeSymbolic(O, CPE.getType(), MF->getFunction()->getParent());
}
O << '\n';
if (CPE.isMachineConstantPoolEntry())
O << TAI->getData64bitsDirective(AddrSpace) << i;
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
- O << TAI->getCommentString() << " double value: " << Val;
+ O << TAI->getCommentString() << " double " << Val;
}
O << '\n';
} else if (TD->isBigEndian()) {
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " double most significant word " << Val;
+ << " most significant word of double " << Val;
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " double least significant word " << Val;
+ << " least significant word of double " << Val;
}
O << '\n';
} else {
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " double least significant word " << Val;
+ << " least significant word of double " << Val;
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << unsigned(i >> 32);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " double most significant word " << Val;
+ << " most significant word of double " << Val;
}
O << '\n';
}
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double most significant halfword of ~"
+ << " most significant halfword of x86_fp80 ~"
<< DoubleVal.convertToDouble();
}
O << '\n';
O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
- O << TAI->getCommentString() << " long double next halfword";
+ O << TAI->getCommentString() << " next halfword";
}
O << '\n';
O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
- O << TAI->getCommentString() << " long double next halfword";
+ O << TAI->getCommentString() << " next halfword";
}
O << '\n';
O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 16);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
- O << TAI->getCommentString() << " long double next halfword";
+ O << TAI->getCommentString() << " next halfword";
}
O << '\n';
O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0]);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double least significant halfword";
+ << " least significant halfword";
}
O << '\n';
} else {
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double least significant halfword of ~"
+ << " least significant halfword of x86_fp80 ~"
<< DoubleVal.convertToDouble();
}
O << '\n';
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double next halfword";
+ << " next halfword";
}
O << '\n';
O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 32);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double next halfword";
+ << " next halfword";
}
O << '\n';
O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[0] >> 48);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double next halfword";
+ << " next halfword";
}
O << '\n';
O << TAI->getData16bitsDirective(AddrSpace) << uint16_t(p[1]);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double most significant halfword";
+ << " most significant halfword";
}
O << '\n';
}
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double most significant word";
+ << " most significant word of ppc_fp128";
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double next word";
+ << " next word";
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double next word";
+ << " next word";
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1]);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double least significant word";
+ << " least significant word";
}
O << '\n';
} else {
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double least significant word";
+ << " least significant word of ppc_fp128";
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[1] >> 32);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double next word";
+ << " next word";
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0]);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double next word";
+ << " next word";
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << uint32_t(p[0] >> 32);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " long double most significant word";
+ << " most significant word";
}
O << '\n';
}
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " Double-word most significant word " << Val;
+ << " most significant half of i64 " << Val;
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " Double-word least significant word " << Val;
+ << " least significant half of i64 " << Val;
}
O << '\n';
} else {
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " Double-word least significant word " << Val;
+ << " least significant half of i64 " << Val;
}
O << '\n';
O << TAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString()
- << " Double-word most significant word " << Val;
+ << " most significant half of i64 " << Val;
}
O << '\n';
}
#include "ARMMachineFunctionInfo.h"
#include "llvm/Constants.h"
#include "llvm/Module.h"
+#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
return Result;
}
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \\n or \\0.
-static void PrintUnmangledNameSafely(const Value *V,
- formatted_raw_ostream &OS) {
- for (StringRef::iterator it = V->getName().begin(),
- ie = V->getName().end(); it != ie; ++it)
- if (isprint(*it))
- OS << *it;
-}
-
void ARMAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
const TargetData *TD = TM.getTargetData();
O << name << ":";
if (VerboseAsm) {
O << "\t\t\t\t" << TAI->getCommentString() << ' ';
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
EmitGlobalConstant(C);
}
if (VerboseAsm) {
O << "\t\t" << TAI->getCommentString() << " ";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << "\n";
return;
O << name << ":";
if (VerboseAsm) {
O << "\t\t\t\t" << TAI->getCommentString() << " ";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << "\n";
if (TAI->hasDotTypeDotSizeDirective())
return Result;
}
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \\n or \\0.
-static void PrintUnmangledNameSafely(const Value *V,
- formatted_raw_ostream &OS) {
- for (StringRef::iterator it = V->getName().begin(),
- ie = V->getName().end(); it != ie; ++it)
- if (isprint(*it))
- OS << *it;
-}
-
/*!
Emit a global variable according to its section, alignment, etc.
O << ".comm " << name << ',' << Size;
}
O << "\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
O << "'\n";
return;
}
EmitAlignment(Align, GVar);
O << name << ":\t\t\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
O << "'\n";
EmitGlobalConstant(C);
return false;
}
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \\n or \\0.
-static void PrintUnmangledNameSafely(const Value *V,
- formatted_raw_ostream &OS) {
- for (StringRef::iterator it = V->getName().begin(),
- ie = V->getName().end(); it != ie; ++it)
- if (isprint(*it))
- OS << *it;
-}
-
void PPCLinuxAsmPrinter::PrintGlobalVariable(const GlobalVariable *GVar) {
const TargetData *TD = TM.getTargetData();
}
if (VerboseAsm) {
O << "\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
O << "'";
}
O << '\n';
O << name << ":";
if (VerboseAsm) {
O << "\t\t\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
O << "'";
}
O << '\n';
O << name << ":";
if (VerboseAsm) {
O << "\t\t\t\t" << TAI->getCommentString() << " ";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
EmitGlobalConstant(C);
}
if (VerboseAsm) {
O << "\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
O << "'";
}
O << '\n';
O << name << ":";
if (VerboseAsm) {
O << "\t\t\t\t" << TAI->getCommentString() << " '";
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
O << "'";
}
O << '\n';
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
+#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
assert(!Index.getReg() && "Should allocate base register first!");
}
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \\n or \\0.
-static void PrintUnmangledNameSafely(const Value *V,
- formatted_raw_ostream &OS) {
- for (StringRef::iterator it = V->getName().begin(),
- ie = V->getName().end(); it != ie; ++it)
- if (isprint(*it))
- OS << *it;
-}
-
void SystemZAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
const TargetData *TD = TM.getTargetData();
if (VerboseAsm) {
O << "\t\t" << TAI->getCommentString() << ' ';
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
return;
O << name << ":";
if (VerboseAsm) {
O << "\t\t\t\t" << TAI->getCommentString() << ' ';
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
if (TAI->hasDotTypeDotSizeDirective())
#include "llvm/Type.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/Assembly/Writer.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCSectionMachO.h"
llvm_unreachable("Don't know how to print PIC label!");
}
-/// PrintUnmangledNameSafely - Print out the printable characters in the name.
-/// Don't print things like \\n or \\0.
-static void PrintUnmangledNameSafely(const Value *V,
- formatted_raw_ostream &OS) {
- for (StringRef::iterator it = V->getName().begin(),
- ie = V->getName().end(); it != ie; ++it)
- if (isprint(*it))
- OS << *it;
-}
-
static X86MachineFunctionInfo calculateFunctionInfo(const Function *F,
const TargetData *TD) {
X86MachineFunctionInfo Info;
<< ";\t.endef\n";
}
- O << CurrentFnName << ":\n";
+ O << CurrentFnName << ':';
+ if (VerboseAsm) {
+ O.PadToColumn(TAI->getCommentColumn(), 1);
+ O << TAI->getCommentString() << ' ';
+ WriteAsOperand(O, F, /*PrintType=*/false, F->getParent());
+ }
+ O << '\n';
+
// Add some workaround for linkonce linkage on Cygwin\MinGW
if (Subtarget->isTargetCygMing() &&
(F->hasLinkOnceLinkage() || F->hasWeakLinkage()))
O << MO.getImm();
return;
case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB(), false, false, VerboseAsm);
+ printBasicBlockLabel(MO.getMBB(), false, false, false);
return;
case MachineOperand::MO_GlobalAddress:
case MachineOperand::MO_ExternalSymbol:
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString() << ' ';
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
EmitGlobalConstant(C);
if (VerboseAsm) {
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString() << ' ';
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
return;
if (VerboseAsm){
O.PadToColumn(TAI->getCommentColumn(), 1);
O << TAI->getCommentString() << ' ';
- PrintUnmangledNameSafely(GVar, O);
+ WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
- if (TAI->hasDotTypeDotSizeDirective())
- O << "\t.size\t" << name << ", " << Size << '\n';
EmitGlobalConstant(C);
+
+ if (TAI->hasDotTypeDotSizeDirective())
+ O << "\t.size\t" << name << ", " << Size << '\n';
}
bool X86ATTAsmPrinter::doFinalization(Module &M) {
O << MO.getImm();
return;
case MachineOperand::MO_MachineBasicBlock:
- printBasicBlockLabel(MO.getMBB());
+ printBasicBlockLabel(MO.getMBB(), false, false, false);
return;
case MachineOperand::MO_GlobalAddress: {
; RUN: llvm-as < %s | llvm-dis
-%0 = type { %1, %2 } ; type %0
-%1 = type { i32 } ; type %1
-%2 = type { float, double } ; type %2
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
+
+module asm "this is an inline asm block"
+module asm "this is another inline asm block"
+
+%0 = type { %1, %2 }
+%1 = type { i32 }
+%2 = type { float, double }
@0 = global i32 0
@1 = global float 3.0
@2 = global i8* null
+@3 = global x86_fp80 0xK4001E000000000000000
define float @foo(%0* %p) nounwind {
%t = load %0* %p ; <%0> [#uses=2]
define i8** @sss() {
ret i8** @2
}
+define x86_fp80* @nnn() {
+ ret x86_fp80* @3
+}
; RUN: llvm-as < %s | llc | grep ly | count 2
; RUN: llvm-as < %s | llc | grep sty | count 2
-; RUN: llvm-as < %s | llc | grep {l.%} | count 2
-; RUN: llvm-as < %s | llc | grep {st.%} | count 2
+; RUN: llvm-as < %s | llc | grep {l %} | count 2
+; RUN: llvm-as < %s | llc | grep {st %} | count 2
target datalayout = "E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-a0:16:16"
target triple = "s390x-linux"
; LINUX: .type G6,@object
; LINUX: .section .gnu.linkonce.r.G6,"a",@progbits
; LINUX: .weak G6
-; LINUX: G6: # G6
-; LINUX: .size G6, 1
+; LINUX: G6:
; LINUX: .ascii "\001"
+; LINUX: .size G6, 1
; DARWIN: .section __TEXT,__const_coal,coalesced
; DARWIN: .globl _G6