Rename getValueName -> getMangledName.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-07-14 06:18:50 +00:00
parent 176a4ab639
commit b09d2ccc0f
12 changed files with 47 additions and 55 deletions

View File

@ -155,9 +155,11 @@ namespace {
ARMConstantPoolValue *ACPV = static_cast<ARMConstantPoolValue*>(MCPV); ARMConstantPoolValue *ACPV = static_cast<ARMConstantPoolValue*>(MCPV);
GlobalValue *GV = ACPV->getGV(); GlobalValue *GV = ACPV->getGV();
std::string Name = GV ? Mang->getValueName(GV) : TAI->getGlobalPrefix(); std::string Name;
if (!GV) if (GV)
Name += ACPV->getSymbol(); Name = Mang->getMangledName(GV);
else
Name = std::string(TAI->getGlobalPrefix()) + ACPV->getSymbol();
if (ACPV->isNonLazyPointer()) { if (ACPV->isNonLazyPointer()) {
if (GV->hasHiddenVisibility()) if (GV->hasHiddenVisibility())
HiddenGVNonLazyPtrs.insert(Name); HiddenGVNonLazyPtrs.insert(Name);
@ -324,7 +326,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
bool isCallOp = Modifier && !strcmp(Modifier, "call"); bool isCallOp = Modifier && !strcmp(Modifier, "call");
GlobalValue *GV = MO.getGlobal(); GlobalValue *GV = MO.getGlobal();
std::string Name = Mang->getValueName(GV); std::string Name = Mang->getMangledName(GV);
bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() || bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() ||
GV->hasLinkOnceLinkage()); GV->hasLinkOnceLinkage());
if (isExt && isCallOp && Subtarget->isTargetDarwin() && if (isExt && isCallOp && Subtarget->isTargetDarwin() &&
@ -1037,7 +1039,7 @@ void ARMAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
return; return;
} }
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
Constant *C = GVar->getInitializer(); Constant *C = GVar->getInitializer();
if (isa<MDNode>(C) || isa<MDString>(C)) if (isa<MDNode>(C) || isa<MDString>(C))
return; return;

View File

@ -117,11 +117,9 @@ void AlphaAsmPrinter::printOp(const MachineOperand &MO, bool IsCallOp) {
O << MO.getSymbolName(); O << MO.getSymbolName();
return; return;
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress:
GlobalValue *GV = MO.getGlobal(); O << Mang->getMangledName(MO.getGlobal());
O << Mang->getValueName(GV);
return; return;
}
case MachineOperand::MO_JumpTableIndex: case MachineOperand::MO_JumpTableIndex:
O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber() O << TAI->getPrivateGlobalPrefix() << "JTI" << getFunctionNumber()
@ -218,7 +216,7 @@ void AlphaAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
if (EmitSpecialLLVMGlobal(GVar)) if (EmitSpecialLLVMGlobal(GVar))
return; return;
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
Constant *C = GVar->getInitializer(); Constant *C = GVar->getInitializer();
if (isa<MDNode>(C) || isa<MDString>(C)) if (isa<MDNode>(C) || isa<MDString>(C))
return; return;

View File

@ -347,7 +347,7 @@ void SPUAsmPrinter::printOp(const MachineOperand &MO) {
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
// Computing the address of a global symbol, not calling it. // Computing the address of a global symbol, not calling it.
GlobalValue *GV = MO.getGlobal(); GlobalValue *GV = MO.getGlobal();
std::string Name = Mang->getValueName(GV); std::string Name = Mang->getMangledName(GV);
// External or weakly linked global variables need non-lazily-resolved // External or weakly linked global variables need non-lazily-resolved
// stubs // stubs
@ -515,7 +515,7 @@ void LinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
if (EmitSpecialLLVMGlobal(GVar)) if (EmitSpecialLLVMGlobal(GVar))
return; return;
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
printVisibility(name, GVar->getVisibility()); printVisibility(name, GVar->getVisibility());

View File

@ -201,16 +201,16 @@ void IA64AsmPrinter::printOp(const MachineOperand &MO,
// Intel ias rightly complains of an 'undefined symbol') // Intel ias rightly complains of an 'undefined symbol')
if (F /*&& isBRCALLinsn*/ && F->isDeclaration()) if (F /*&& isBRCALLinsn*/ && F->isDeclaration())
ExternalFunctionNames.insert(Mang->getValueName(MO.getGlobal())); ExternalFunctionNames.insert(Mang->getMangledName(MO.getGlobal()));
else else
if (GV->isDeclaration()) // e.g. stuff like 'stdin' if (GV->isDeclaration()) // e.g. stuff like 'stdin'
ExternalObjectNames.insert(Mang->getValueName(MO.getGlobal())); ExternalObjectNames.insert(Mang->getMangledName(MO.getGlobal()));
if (!isBRCALLinsn) if (!isBRCALLinsn)
O << "@ltoff("; O << "@ltoff(";
if (Needfptr) if (Needfptr)
O << "@fptr("; O << "@fptr(";
O << Mang->getValueName(MO.getGlobal()); O << Mang->getMangledName(MO.getGlobal());
if (Needfptr && !isBRCALLinsn) if (Needfptr && !isBRCALLinsn)
O << "#))"; // close both fptr( and ltoff( O << "#))"; // close both fptr( and ltoff(
@ -268,7 +268,7 @@ void IA64AsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
return; return;
O << "\n\n"; O << "\n\n";
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
Constant *C = GVar->getInitializer(); Constant *C = GVar->getInitializer();
if (isa<MDNode>(C) || isa<MDString>(C)) if (isa<MDNode>(C) || isa<MDString>(C))
return; return;

View File

@ -242,7 +242,7 @@ bool MSILWriter::isZeroValue(const Value* V) {
std::string MSILWriter::getValueName(const Value* V) { std::string MSILWriter::getValueName(const Value* V) {
std::string Name; std::string Name;
if (const GlobalValue *GV = cast<GlobalValue>(V)) if (const GlobalValue *GV = cast<GlobalValue>(V))
Name = Mang->getValueName(GV); Name = Mang->getMangledName(GV);
else { else {
unsigned &No = AnonValueNumbers[V]; unsigned &No = AnonValueNumbers[V];
if (No == 0) No = ++NextAnonValueNumber; if (No == 0) No = ++NextAnonValueNumber;
@ -269,7 +269,7 @@ std::string MSILWriter::getLabelName(const std::string& Name) {
std::string MSILWriter::getLabelName(const Value* V) { std::string MSILWriter::getLabelName(const Value* V) {
std::string Name; std::string Name;
if (const GlobalValue *GV = cast<GlobalValue>(V)) if (const GlobalValue *GV = cast<GlobalValue>(V))
Name = Mang->getValueName(GV); Name = Mang->getMangledName(GV);
else { else {
unsigned &No = AnonValueNumbers[V]; unsigned &No = AnonValueNumbers[V];
if (No == 0) No = ++NextAnonValueNumber; if (No == 0) No = ++NextAnonValueNumber;
@ -1619,7 +1619,7 @@ const char* MSILWriter::getLibraryName(const Function* F) {
const char* MSILWriter::getLibraryName(const GlobalVariable* GV) { const char* MSILWriter::getLibraryName(const GlobalVariable* GV) {
return getLibraryForSymbol(Mang->getValueName(GV).c_str(), false, 0); return getLibraryForSymbol(Mang->getMangledName(GV).c_str(), false, 0);
} }
@ -1677,7 +1677,7 @@ void MSILWriter::printExternals() {
std::string Tmp = getTypeName(I->getType())+getValueName(&*I); std::string Tmp = getTypeName(I->getType())+getValueName(&*I);
printSimpleInstruction("ldsflda",Tmp.c_str()); printSimpleInstruction("ldsflda",Tmp.c_str());
Out << "\tldstr\t\"" << getLibraryName(&*I) << "\"\n"; Out << "\tldstr\t\"" << getLibraryName(&*I) << "\"\n";
Out << "\tldstr\t\"" << Mang->getValueName(&*I) << "\"\n"; Out << "\tldstr\t\"" << Mang->getMangledName(&*I) << "\"\n";
printSimpleInstruction("call","void* $MSIL_Import(string,string)"); printSimpleInstruction("call","void* $MSIL_Import(string,string)");
printIndirectSave(I->getType()); printIndirectSave(I->getType());
} }

View File

@ -185,7 +185,7 @@ void MSP430AsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
bool isMemOp = Modifier && !strcmp(Modifier, "mem"); bool isMemOp = Modifier && !strcmp(Modifier, "mem");
bool isCallOp = Modifier && !strcmp(Modifier, "call"); bool isCallOp = Modifier && !strcmp(Modifier, "call");
std::string Name = Mang->getValueName(MO.getGlobal()); std::string Name = Mang->getMangledName(MO.getGlobal());
assert(MO.getOffset() == 0 && "No offsets allowed!"); assert(MO.getOffset() == 0 && "No offsets allowed!");
if (isCallOp) if (isCallOp)

View File

@ -385,10 +385,7 @@ printOperand(const MachineInstr *MI, int opNum)
return; return;
case MachineOperand::MO_GlobalAddress: case MachineOperand::MO_GlobalAddress:
{ O << Mang->getMangledName(MO.getGlobal());
const GlobalValue *GV = MO.getGlobal();
O << Mang->getValueName(GV);
}
break; break;
case MachineOperand::MO_ExternalSymbol: case MachineOperand::MO_ExternalSymbol:
@ -481,7 +478,7 @@ printModuleLevelGV(const GlobalVariable* GVar) {
return; return;
O << "\n\n"; O << "\n\n";
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
Constant *C = GVar->getInitializer(); Constant *C = GVar->getInitializer();
if (isa<MDNode>(C) || isa<MDString>(C)) if (isa<MDNode>(C) || isa<MDString>(C))
return; return;

View File

@ -47,7 +47,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Get the mangled name. // Get the mangled name.
const Function *F = MF.getFunction(); const Function *F = MF.getFunction();
CurrentFnName = Mang->getValueName(F); CurrentFnName = Mang->getMangledName(F);
// Emit the function frame (args and temps). // Emit the function frame (args and temps).
EmitFunctionFrame(MF); EmitFunctionFrame(MF);
@ -136,7 +136,7 @@ void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
return; return;
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
O << Mang->getValueName(MO.getGlobal()); O << Mang->getMangledName(MO.getGlobal());
break; break;
} }
case MachineOperand::MO_ExternalSymbol: { case MachineOperand::MO_ExternalSymbol: {
@ -222,7 +222,7 @@ void PIC16AsmPrinter::EmitFunctionDecls (Module &M) {
// Emit declarations for external functions. // Emit declarations for external functions.
O <<"\n"<<TAI->getCommentString() << "Function Declarations - BEGIN." <<"\n"; O <<"\n"<<TAI->getCommentString() << "Function Declarations - BEGIN." <<"\n";
for (Module::iterator I = M.begin(), E = M.end(); I != E; I++) { for (Module::iterator I = M.begin(), E = M.end(); I != E; I++) {
std::string Name = Mang->getValueName(I); std::string Name = Mang->getMangledName(I);
if (Name.compare("@abort") == 0) if (Name.compare("@abort") == 0)
continue; continue;
@ -252,7 +252,7 @@ void PIC16AsmPrinter::EmitUndefinedVars (Module &M)
O << "\n" << TAI->getCommentString() << "Imported Variables - BEGIN" << "\n"; O << "\n" << TAI->getCommentString() << "Imported Variables - BEGIN" << "\n";
for (unsigned j = 0; j < Items.size(); j++) { for (unsigned j = 0; j < Items.size(); j++) {
O << TAI->getExternDirective() << Mang->getValueName(Items[j]) << "\n"; O << TAI->getExternDirective() << Mang->getMangledName(Items[j]) << "\n";
} }
O << TAI->getCommentString() << "Imported Variables - END" << "\n"; O << TAI->getCommentString() << "Imported Variables - END" << "\n";
} }
@ -265,7 +265,7 @@ void PIC16AsmPrinter::EmitDefinedVars (Module &M)
O << "\n" << TAI->getCommentString() << "Exported Variables - BEGIN" << "\n"; O << "\n" << TAI->getCommentString() << "Exported Variables - BEGIN" << "\n";
for (unsigned j = 0; j < Items.size(); j++) { for (unsigned j = 0; j < Items.size(); j++) {
O << TAI->getGlobalDirective() << Mang->getValueName(Items[j]) << "\n"; O << TAI->getGlobalDirective() << Mang->getMangledName(Items[j]) << "\n";
} }
O << TAI->getCommentString() << "Exported Variables - END" << "\n"; O << TAI->getCommentString() << "Exported Variables - END" << "\n";
} }
@ -281,7 +281,7 @@ void PIC16AsmPrinter::EmitRomData (Module &M)
O << "\n"; O << "\n";
SwitchToSection(PTAI->ROSections[i]->S_); SwitchToSection(PTAI->ROSections[i]->S_);
for (unsigned j = 0; j < Items.size(); j++) { for (unsigned j = 0; j < Items.size(); j++) {
O << Mang->getValueName(Items[j]); O << Mang->getMangledName(Items[j]);
Constant *C = Items[j]->getInitializer(); Constant *C = Items[j]->getInitializer();
int AddrSpace = Items[j]->getType()->getAddressSpace(); int AddrSpace = Items[j]->getType()->getAddressSpace();
EmitGlobalConstant(C, AddrSpace); EmitGlobalConstant(C, AddrSpace);
@ -300,7 +300,7 @@ bool PIC16AsmPrinter::doFinalization(Module &M) {
void PIC16AsmPrinter::EmitFunctionFrame(MachineFunction &MF) { void PIC16AsmPrinter::EmitFunctionFrame(MachineFunction &MF) {
const Function *F = MF.getFunction(); const Function *F = MF.getFunction();
std::string FuncName = Mang->getValueName(F); std::string FuncName = Mang->getMangledName(F);
const TargetData *TD = TM.getTargetData(); const TargetData *TD = TM.getTargetData();
// Emit the data section name. // Emit the data section name.
O << "\n"; O << "\n";
@ -354,7 +354,7 @@ void PIC16AsmPrinter::EmitIData (Module &M) {
SwitchToSection(IDATASections[i]->S_); SwitchToSection(IDATASections[i]->S_);
std::vector<const GlobalVariable*> Items = IDATASections[i]->Items; std::vector<const GlobalVariable*> Items = IDATASections[i]->Items;
for (unsigned j = 0; j < Items.size(); j++) { for (unsigned j = 0; j < Items.size(); j++) {
std::string Name = Mang->getValueName(Items[j]); std::string Name = Mang->getMangledName(Items[j]);
Constant *C = Items[j]->getInitializer(); Constant *C = Items[j]->getInitializer();
int AddrSpace = Items[j]->getType()->getAddressSpace(); int AddrSpace = Items[j]->getType()->getAddressSpace();
O << Name; O << Name;
@ -373,7 +373,7 @@ void PIC16AsmPrinter::EmitUData (Module &M) {
SwitchToSection(BSSSections[i]->S_); SwitchToSection(BSSSections[i]->S_);
std::vector<const GlobalVariable*> Items = BSSSections[i]->Items; std::vector<const GlobalVariable*> Items = BSSSections[i]->Items;
for (unsigned j = 0; j < Items.size(); j++) { for (unsigned j = 0; j < Items.size(); j++) {
std::string Name = Mang->getValueName(Items[j]); std::string Name = Mang->getMangledName(Items[j]);
Constant *C = Items[j]->getInitializer(); Constant *C = Items[j]->getInitializer();
const Type *Ty = C->getType(); const Type *Ty = C->getType();
unsigned Size = TD->getTypeAllocSize(Ty); unsigned Size = TD->getTypeAllocSize(Ty);
@ -401,7 +401,7 @@ void PIC16AsmPrinter::EmitAutos (std::string FunctName)
SwitchToSection(AutosSections[i]->S_); SwitchToSection(AutosSections[i]->S_);
std::vector<const GlobalVariable*> Items = AutosSections[i]->Items; std::vector<const GlobalVariable*> Items = AutosSections[i]->Items;
for (unsigned j = 0; j < Items.size(); j++) { for (unsigned j = 0; j < Items.size(); j++) {
std::string VarName = Mang->getValueName(Items[j]); std::string VarName = Mang->getMangledName(Items[j]);
Constant *C = Items[j]->getInitializer(); Constant *C = Items[j]->getInitializer();
const Type *Ty = C->getType(); const Type *Ty = C->getType();
unsigned Size = TD->getTypeAllocSize(Ty); unsigned Size = TD->getTypeAllocSize(Ty);
@ -434,7 +434,7 @@ void PIC16AsmPrinter::EmitRemainingAutos()
SwitchToSection(AutosSections[i]->S_); SwitchToSection(AutosSections[i]->S_);
std::vector<const GlobalVariable*> Items = AutosSections[i]->Items; std::vector<const GlobalVariable*> Items = AutosSections[i]->Items;
for (unsigned j = 0; j < Items.size(); j++) { for (unsigned j = 0; j < Items.size(); j++) {
std::string VarName = Mang->getValueName(Items[j]); std::string VarName = Mang->getMangledName(Items[j]);
Constant *C = Items[j]->getInitializer(); Constant *C = Items[j]->getInitializer();
const Type *Ty = C->getType(); const Type *Ty = C->getType();
unsigned Size = TD->getTypeAllocSize(Ty); unsigned Size = TD->getTypeAllocSize(Ty);

View File

@ -191,7 +191,7 @@ namespace {
GlobalValue *GV = MO.getGlobal(); GlobalValue *GV = MO.getGlobal();
if (GV->isDeclaration() || GV->isWeakForLinker()) { if (GV->isDeclaration() || GV->isWeakForLinker()) {
// Dynamically-resolved functions need a stub for the function. // Dynamically-resolved functions need a stub for the function.
std::string Name = Mang->getValueName(GV); std::string Name = Mang->getMangledName(GV);
FnStubs.insert(Name); FnStubs.insert(Name);
printSuffixedName(Name, "$stub"); printSuffixedName(Name, "$stub");
return; return;
@ -376,7 +376,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
// Computing the address of a global symbol, not calling it. // Computing the address of a global symbol, not calling it.
GlobalValue *GV = MO.getGlobal(); GlobalValue *GV = MO.getGlobal();
std::string Name = Mang->getValueName(GV); std::string Name = Mang->getMangledName(GV);
// External or weakly linked global variables need non-lazily-resolved stubs // External or weakly linked global variables need non-lazily-resolved stubs
if (TM.getRelocationModel() != Reloc::Static) { if (TM.getRelocationModel() != Reloc::Static) {
@ -646,7 +646,7 @@ void PPCLinuxAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
if (EmitSpecialLLVMGlobal(GVar)) if (EmitSpecialLLVMGlobal(GVar))
return; return;
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
printVisibility(name, GVar->getVisibility()); printVisibility(name, GVar->getVisibility());
@ -865,8 +865,7 @@ void PPCDarwinAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
return; return;
} }
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
printVisibility(name, GVar->getVisibility()); printVisibility(name, GVar->getVisibility());
Constant *C = GVar->getInitializer(); Constant *C = GVar->getInitializer();

View File

@ -172,10 +172,7 @@ void SparcAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
printBasicBlockLabel(MO.getMBB()); printBasicBlockLabel(MO.getMBB());
return; return;
case MachineOperand::MO_GlobalAddress: case MachineOperand::MO_GlobalAddress:
{ O << Mang->getMangledName(MO.getGlobal());
const GlobalValue *GV = MO.getGlobal();
O << Mang->getValueName(GV);
}
break; break;
case MachineOperand::MO_ExternalSymbol: case MachineOperand::MO_ExternalSymbol:
O << MO.getSymbolName(); O << MO.getSymbolName();
@ -251,7 +248,7 @@ void SparcAsmPrinter::printModuleLevelGV(const GlobalVariable* GVar) {
return; return;
O << "\n\n"; O << "\n\n";
std::string name = Mang->getValueName(GVar); std::string name = Mang->getMangledName(GVar);
Constant *C = GVar->getInitializer(); Constant *C = GVar->getInitializer();
if (isa<MDNode>(C) || isa<MDString>(C)) if (isa<MDNode>(C) || isa<MDString>(C))
return; return;

View File

@ -240,8 +240,7 @@ void X86IntelAsmPrinter::printOp(const MachineOperand &MO,
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
bool isMemOp = Modifier && !strcmp(Modifier, "mem"); bool isMemOp = Modifier && !strcmp(Modifier, "mem");
GlobalValue *GV = MO.getGlobal(); GlobalValue *GV = MO.getGlobal();
std::string Name = Mang->getValueName(GV); std::string Name = Mang->getMangledName(GV);
decorateName(Name, GV); decorateName(Name, GV);
if (!isMemOp) O << "OFFSET "; if (!isMemOp) O << "OFFSET ";
@ -278,7 +277,7 @@ void X86IntelAsmPrinter::print_pcrel_imm(const MachineInstr *MI, unsigned OpNo){
case MachineOperand::MO_GlobalAddress: { case MachineOperand::MO_GlobalAddress: {
GlobalValue *GV = MO.getGlobal(); GlobalValue *GV = MO.getGlobal();
std::string Name = Mang->getValueName(GV); std::string Name = Mang->getMangledName(GV);
decorateName(Name, GV); decorateName(Name, GV);
// Handle dllimport linkage. // Handle dllimport linkage.
@ -446,7 +445,7 @@ bool X86IntelAsmPrinter::doInitialization(Module &M) {
// Emit declarations for external functions. // Emit declarations for external functions.
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
if (I->isDeclaration()) { if (I->isDeclaration()) {
std::string Name = Mang->getValueName(I); std::string Name = Mang->getMangledName(I);
decorateName(Name, I); decorateName(Name, I);
O << "\tEXTERN " ; O << "\tEXTERN " ;
@ -461,7 +460,7 @@ bool X86IntelAsmPrinter::doInitialization(Module &M) {
for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); for (Module::const_global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I) { I != E; ++I) {
if (I->isDeclaration()) { if (I->isDeclaration()) {
std::string Name = Mang->getValueName(I); std::string Name = Mang->getMangledName(I);
O << "\tEXTERN " ; O << "\tEXTERN " ;
if (I->hasDLLImportLinkage()) { if (I->hasDLLImportLinkage()) {
@ -486,7 +485,7 @@ bool X86IntelAsmPrinter::doFinalization(Module &M) {
if (EmitSpecialLLVMGlobal(I)) if (EmitSpecialLLVMGlobal(I))
continue; continue;
std::string name = Mang->getValueName(I); std::string name = Mang->getMangledName(I);
Constant *C = I->getInitializer(); Constant *C = I->getInitializer();
unsigned Align = TD->getPreferredAlignmentLog(I); unsigned Align = TD->getPreferredAlignmentLog(I);
bool bCustomSegment = false; bool bCustomSegment = false;

View File

@ -178,7 +178,7 @@ emitGlobal(const GlobalVariable *GV)
SwitchToSection(TAI->SectionForGlobal(GV)); SwitchToSection(TAI->SectionForGlobal(GV));
std::string name = Mang->getValueName(GV); std::string name = Mang->getMangledName(GV);
Constant *C = GV->getInitializer(); Constant *C = GV->getInitializer();
unsigned Align = (unsigned)TD->getPreferredTypeAlignmentShift(C->getType()); unsigned Align = (unsigned)TD->getPreferredTypeAlignmentShift(C->getType());
@ -367,7 +367,7 @@ void XCoreAsmPrinter::printOperand(const MachineInstr *MI, int opNum) {
printBasicBlockLabel(MO.getMBB()); printBasicBlockLabel(MO.getMBB());
break; break;
case MachineOperand::MO_GlobalAddress: case MachineOperand::MO_GlobalAddress:
O << Mang->getValueName(MO.getGlobal()); O << Mang->getMangledName(MO.getGlobal());
break; break;
case MachineOperand::MO_ExternalSymbol: case MachineOperand::MO_ExternalSymbol:
O << MO.getSymbolName(); O << MO.getSymbolName();