mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-29 10:25:12 +00:00
Handle \n's in value names for more targets. The asm printers
really really really need refactoring :( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47171 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -807,6 +807,15 @@ bool ARMAsmPrinter::doInitialization(Module &M) {
|
||||
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, std::ostream &OS) {
|
||||
for (const char *Name = V->getNameStart(), *E = Name+V->getNameLen();
|
||||
Name != E; ++Name)
|
||||
if (isprint(*Name))
|
||||
OS << *Name;
|
||||
}
|
||||
|
||||
bool ARMAsmPrinter::doFinalization(Module &M) {
|
||||
const TargetData *TD = TM.getTargetData();
|
||||
|
||||
@@ -875,7 +884,9 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
|
||||
if (TAI->getCOMMDirectiveTakesAlignment())
|
||||
O << "," << (TAI->getAlignmentIsInBytes() ? (1 << Align) : Align);
|
||||
}
|
||||
O << "\t\t" << TAI->getCommentString() << " " << I->getName() << "\n";
|
||||
O << "\t\t" << TAI->getCommentString() << " ";
|
||||
PrintUnmangledNameSafely(I, O);
|
||||
O << "\n";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -961,8 +972,9 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
|
||||
}
|
||||
|
||||
EmitAlignment(Align, I);
|
||||
O << name << ":\t\t\t\t" << TAI->getCommentString() << " " << I->getName()
|
||||
<< "\n";
|
||||
O << name << ":\t\t\t\t" << TAI->getCommentString() << " ";
|
||||
PrintUnmangledNameSafely(I, O);
|
||||
O << "\n";
|
||||
if (TAI->hasDotTypeDotSizeDirective())
|
||||
O << "\t.size " << name << ", " << Size << "\n";
|
||||
// If the initializer is a extern weak symbol, remember to emit the weak
|
||||
|
Reference in New Issue
Block a user