[llvm-branch-commits] [llvm-branch] r68748 - in /llvm/branches/Apple/Dib: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp lib/CodeGen/AsmPrinter/DwarfWriter.cpp lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
Bill Wendling
isanbard at gmail.com
Thu Apr 9 17:15:15 PDT 2009
Author: void
Date: Thu Apr 9 19:15:14 2009
New Revision: 68748
URL: http://llvm.org/viewvc/llvm-project?rev=68748&view=rev
Log:
--- Merging (from foreign repository) r68745 into '.':
U include/llvm/CodeGen/AsmPrinter.h
U lib/CodeGen/AsmPrinter/DwarfWriter.cpp
U lib/CodeGen/AsmPrinter/AsmPrinter.cpp
--- Merging (from foreign repository) r68747 into '.':
G include/llvm/CodeGen/AsmPrinter.h
G lib/CodeGen/AsmPrinter/DwarfWriter.cpp
G lib/CodeGen/AsmPrinter/AsmPrinter.cpp
U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
Modified:
llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h
llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
Modified: llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h?rev=68748&r1=68747&r2=68748&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/branches/Apple/Dib/include/llvm/CodeGen/AsmPrinter.h Thu Apr 9 19:15:14 2009
@@ -153,7 +153,8 @@
/// getGlobalLinkName - Returns the asm/link name of of the specified
/// global variable. Should be overridden by each target asm printer to
/// generate the appropriate value.
- virtual const std::string getGlobalLinkName(const GlobalVariable *GV) const;
+ virtual const std::string &getGlobalLinkName(const GlobalVariable *GV,
+ std::string &LinkName) const;
/// EmitExternalGlobal - Emit the external reference to a global variable.
/// Should be overridden if an indirect reference should be used.
@@ -162,7 +163,8 @@
/// getCurrentFunctionEHName - Called to return (and cache) the
/// CurrentFnEHName.
///
- std::string getCurrentFunctionEHName(const MachineFunction *MF);
+ const std::string &getCurrentFunctionEHName(const MachineFunction *MF,
+ std::string &FuncEHName) const;
protected:
/// getAnalysisUsage - Record analysis usage.
Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=68748&r1=68747&r2=68748&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Thu Apr 9 19:15:14 2009
@@ -186,11 +186,8 @@
SwitchToDataSection("");
for (std::set<const GlobalValue*>::iterator i = ExtWeakSymbols.begin(),
- e = ExtWeakSymbols.end(); i != e; ++i) {
- const GlobalValue *GV = *i;
- std::string Name = Mang->getValueName(GV);
- O << TAI->getWeakRefDirective() << Name << '\n';
- }
+ e = ExtWeakSymbols.end(); i != e; ++i)
+ O << TAI->getWeakRefDirective() << Mang->getValueName(*i) << '\n';
}
if (TAI->getSetDirective()) {
@@ -236,13 +233,16 @@
return false;
}
-std::string AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF) {
+const std::string &
+AsmPrinter::getCurrentFunctionEHName(const MachineFunction *MF,
+ std::string &Name) const {
assert(MF && "No machine function?");
- std::string Name = MF->getFunction()->getName();
+ Name = MF->getFunction()->getName();
if (Name.empty())
Name = Mang->getValueName(MF->getFunction());
- return Mang->makeNameProper(TAI->getEHGlobalPrefix() +
+ Name = Mang->makeNameProper(TAI->getEHGlobalPrefix() +
Name + ".eh", TAI->getGlobalPrefix());
+ return Name;
}
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
@@ -535,9 +535,8 @@
/// getGlobalLinkName - Returns the asm/link name of of the specified
/// global variable. Should be overridden by each target asm printer to
/// generate the appropriate value.
-const std::string AsmPrinter::getGlobalLinkName(const GlobalVariable *GV) const{
- std::string LinkName;
-
+const std::string &AsmPrinter::getGlobalLinkName(const GlobalVariable *GV,
+ std::string &LinkName) const {
if (isa<Function>(GV)) {
LinkName += TAI->getFunctionAddrPrefix();
LinkName += Mang->getValueName(GV);
@@ -554,7 +553,8 @@
/// EmitExternalGlobal - Emit the external reference to a global variable.
/// Should be overridden if an indirect reference should be used.
void AsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) {
- O << getGlobalLinkName(GV);
+ std::string GLN;
+ O << getGlobalLinkName(GV, GLN);
}
Modified: llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp?rev=68748&r1=68747&r2=68748&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/CodeGen/AsmPrinter/DwarfWriter.cpp Thu Apr 9 19:15:14 2009
@@ -858,7 +858,7 @@
//===--------------------------------------------------------------------===//
// Accessors.
//
- AsmPrinter *getAsm() const { return Asm; }
+ const AsmPrinter *getAsm() const { return Asm; }
MachineModuleInfo *getMMI() const { return MMI; }
const TargetAsmInfo *getTargetAsmInfo() const { return TAI; }
const TargetData *getTargetData() const { return TD; }
@@ -2886,8 +2886,9 @@
// Add address.
DIEBlock *Block = new DIEBlock();
AddUInt(Block, 0, DW_FORM_data1, DW_OP_addr);
+ std::string GLN;
AddObjectLabel(Block, 0, DW_FORM_udata,
- Asm->getGlobalLinkName(DI_GV.getGlobal()));
+ Asm->getGlobalLinkName(DI_GV.getGlobal(), GLN));
AddBlock(VariableDie, DW_AT_location, 0, Block);
// Add to map.
@@ -4007,10 +4008,12 @@
PrintRelDirective();
- if (GV)
- O << Asm->getGlobalLinkName(GV);
- else
+ if (GV) {
+ std::string GLN;
+ O << Asm->getGlobalLinkName(GV, GLN);
+ } else {
O << "0";
+ }
Asm->EOL("TypeInfo");
}
@@ -4118,14 +4121,15 @@
EmitExceptionTable();
// Save EH frame information
- EHFrames.
- push_back(FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF),
- SubprogramCount,
- MMI->getPersonalityIndex(),
- MF->getFrameInfo()->hasCalls(),
- !MMI->getLandingPads().empty(),
- MMI->getFrameMoves(),
- MF->getFunction()));
+ std::string Name;
+ EHFrames.push_back(
+ FunctionEHFrameInfo(getAsm()->getCurrentFunctionEHName(MF, Name),
+ SubprogramCount,
+ MMI->getPersonalityIndex(),
+ MF->getFrameInfo()->hasCalls(),
+ !MMI->getLandingPads().empty(),
+ MMI->getFrameMoves(),
+ MF->getFunction()));
}
if (TimePassesIsEnabled)
Modified: llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=68748&r1=68747&r2=68748&view=diff
==============================================================================
--- llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Dib/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Thu Apr 9 19:15:14 2009
@@ -423,7 +423,8 @@
/// EmitExternalGlobal - In this case we need to use the indirect symbol.
///
void PPCAsmPrinter::EmitExternalGlobal(const GlobalVariable *GV) {
- std::string Name = getGlobalLinkName(GV);
+ std::string Name;
+ getGlobalLinkName(GV, Name);
if (TM.getRelocationModel() != Reloc::Static) {
if (GV->hasHiddenVisibility())
HiddenGVStubs.insert(Name);
More information about the llvm-branch-commits
mailing list