mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
use both the Mangler and the CBE's mangler for identifiers,
this should fix a problem duncan saw handling symbols with '.' in them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94192 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -351,7 +351,7 @@ namespace {
|
|||||||
char CWriter::ID = 0;
|
char CWriter::ID = 0;
|
||||||
|
|
||||||
|
|
||||||
static std::string MangleType(const std::string &S) {
|
static std::string CBEMangle(const std::string &S) {
|
||||||
std::string Result;
|
std::string Result;
|
||||||
|
|
||||||
for (unsigned i = 0, e = S.size(); i != e; ++i)
|
for (unsigned i = 0, e = S.size(); i != e; ++i)
|
||||||
@@ -1460,7 +1460,7 @@ std::string CWriter::GetValueName(const Value *Operand) {
|
|||||||
if (const GlobalValue *GV = dyn_cast<GlobalValue>(Operand)) {
|
if (const GlobalValue *GV = dyn_cast<GlobalValue>(Operand)) {
|
||||||
SmallString<128> Str;
|
SmallString<128> Str;
|
||||||
Mang->getNameWithPrefix(Str, GV, false);
|
Mang->getNameWithPrefix(Str, GV, false);
|
||||||
return Str.str().str();
|
return CBEMangle(Str.str().str());
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Name = Operand->getName();
|
std::string Name = Operand->getName();
|
||||||
@@ -2247,7 +2247,7 @@ void CWriter::printModuleTypes(const TypeSymbolTable &TST) {
|
|||||||
// Print out forward declarations for structure types before anything else!
|
// Print out forward declarations for structure types before anything else!
|
||||||
Out << "/* Structure forward decls */\n";
|
Out << "/* Structure forward decls */\n";
|
||||||
for (; I != End; ++I) {
|
for (; I != End; ++I) {
|
||||||
std::string Name = "struct " + MangleType("l_"+I->first);
|
std::string Name = "struct " + CBEMangle("l_"+I->first);
|
||||||
Out << Name << ";\n";
|
Out << Name << ";\n";
|
||||||
TypeNames.insert(std::make_pair(I->second, Name));
|
TypeNames.insert(std::make_pair(I->second, Name));
|
||||||
}
|
}
|
||||||
@@ -2258,7 +2258,7 @@ void CWriter::printModuleTypes(const TypeSymbolTable &TST) {
|
|||||||
// for struct or opaque types.
|
// for struct or opaque types.
|
||||||
Out << "/* Typedefs */\n";
|
Out << "/* Typedefs */\n";
|
||||||
for (I = TST.begin(); I != End; ++I) {
|
for (I = TST.begin(); I != End; ++I) {
|
||||||
std::string Name = MangleType("l_"+I->first);
|
std::string Name = CBEMangle("l_"+I->first);
|
||||||
Out << "typedef ";
|
Out << "typedef ";
|
||||||
printType(Out, I->second, false, Name);
|
printType(Out, I->second, false, Name);
|
||||||
Out << ";\n";
|
Out << ";\n";
|
||||||
|
Reference in New Issue
Block a user