diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-12 23:32:33 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-12 23:32:33 +0000 |
commit | 39c2d2f74acd7373ced4b282e5b2c6215d80c7e1 (patch) | |
tree | f9b3d3c62fff3308052104b329a4a487fec4f82d /lib/VMCore | |
parent | 4ca7f9b765928d3d02d657aaf992658e2d39864f (diff) | |
download | external_llvm-39c2d2f74acd7373ced4b282e5b2c6215d80c7e1.zip external_llvm-39c2d2f74acd7373ced4b282e5b2c6215d80c7e1.tar.gz external_llvm-39c2d2f74acd7373ced4b282e5b2c6215d80c7e1.tar.bz2 |
Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."
and unnamed numbered global variables as "@0 = global ...". Extend the
AsmParser to recognize these forms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 602047e..c2a121a 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1442,10 +1442,8 @@ static void PrintVisibility(GlobalValue::VisibilityTypes Vis, } void AssemblyWriter::printGlobal(const GlobalVariable *GV) { - if (GV->hasName()) { - PrintLLVMName(Out, GV); - Out << " = "; - } + WriteAsOperandInternal(Out, GV, TypePrinter, &Machine); + Out << " = "; if (!GV->hasInitializer() && GV->hasExternalLinkage()) Out << "external "; @@ -1518,7 +1516,7 @@ void AssemblyWriter::printAlias(const GlobalAlias *GA) { void AssemblyWriter::printTypeSymbolTable(const TypeSymbolTable &ST) { // Emit all numbered types. for (unsigned i = 0, e = NumberedTypes.size(); i != e; ++i) { - Out << "\ttype "; + Out << '%' << i << " = type "; // Make sure we print out at least one level of the type structure, so // that we do not get %2 = type %2 @@ -1530,7 +1528,6 @@ void AssemblyWriter::printTypeSymbolTable(const TypeSymbolTable &ST) { // Print the named types. for (TypeSymbolTable::const_iterator TI = ST.begin(), TE = ST.end(); TI != TE; ++TI) { - Out << '\t'; PrintLLVMName(Out, TI->first, LocalPrefix); Out << " = type "; @@ -1737,6 +1734,7 @@ void AssemblyWriter::printInfoComment(const Value &V) { void AssemblyWriter::printInstruction(const Instruction &I) { if (AnnotationWriter) AnnotationWriter->emitInstructionAnnot(&I, Out); + // Print out indentation for an instruction. Out << '\t'; // Print out name if it exists... |