Various AsmWriter output cleanups. Use WriteAsOperand instead of

PrintUnmangledNameSafely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78878 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2009-08-13 01:36:44 +00:00
parent 38cff389af
commit cf20ac4fd1
10 changed files with 76 additions and 106 deletions

View File

@@ -19,6 +19,7 @@
#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"
@@ -297,16 +298,6 @@ void SystemZAsmPrinter::printRRIAddrOperand(const MachineInstr *MI, int OpNum,
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();
@@ -343,7 +334,7 @@ void SystemZAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
if (VerboseAsm) {
O << "\t\t" << TAI->getCommentString() << ' ';
PrintUnmangledNameSafely(GVar, O);
WriteAsOperand(O, GVar, /*PrintType=*/false, GVar->getParent());
}
O << '\n';
return;
@@ -378,7 +369,7 @@ void SystemZAsmPrinter::PrintGlobalVariable(const GlobalVariable* GVar) {
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())