diff options
author | Daniel Jasper <djasper@google.com> | 2014-02-19 12:26:01 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-02-19 12:26:01 +0000 |
commit | 7e198ad862cddf373edcb51801a9800c4637d52e (patch) | |
tree | 7a97a155d36e3ccc331ec56d3e18a7eefae5c408 /llvm/lib/Target/TargetLoweringObjectFile.cpp | |
parent | d495642c5410f11345c03fcaa35fd346ad9ab207 (diff) | |
download | bcm5719-llvm-7e198ad862cddf373edcb51801a9800c4637d52e.tar.gz bcm5719-llvm-7e198ad862cddf373edcb51801a9800c4637d52e.zip |
Revert r201622 and r201608.
This causes the LLVMgold plugin to segfault. More information on the
replies to r201608.
llvm-svn: 201669
Diffstat (limited to 'llvm/lib/Target/TargetLoweringObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/TargetLoweringObjectFile.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/llvm/lib/Target/TargetLoweringObjectFile.cpp b/llvm/lib/Target/TargetLoweringObjectFile.cpp index 9fff220d47d..a0218a83df1 100644 --- a/llvm/lib/Target/TargetLoweringObjectFile.cpp +++ b/llvm/lib/Target/TargetLoweringObjectFile.cpp @@ -28,7 +28,6 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetOptions.h" using namespace llvm; @@ -100,22 +99,30 @@ static bool IsNullTerminatedString(const Constant *C) { return false; } +/// Return the MCSymbol for the specified global value. This +/// symbol is the main label that is the address of the global. +MCSymbol *TargetLoweringObjectFile::getSymbol(const GlobalValue *GV, + Mangler &M) const { + SmallString<60> NameStr; + M.getNameWithPrefix(NameStr, GV); + return Ctx->GetOrCreateSymbol(NameStr.str()); +} + MCSymbol *TargetLoweringObjectFile::getSymbolWithGlobalValueBase( - const GlobalValue *GV, StringRef Suffix, Mangler &Mang, - const TargetMachine &TM) const { + const GlobalValue *GV, StringRef Suffix, Mangler &M) const { assert(!Suffix.empty()); SmallString<60> NameStr; NameStr += DL->getPrivateGlobalPrefix(); - TM.getTargetLowering()->getNameWithPrefix(NameStr, GV, Mang); + M.getNameWithPrefix(NameStr, GV); NameStr.append(Suffix.begin(), Suffix.end()); return Ctx->GetOrCreateSymbol(NameStr.str()); } -MCSymbol *TargetLoweringObjectFile::getCFIPersonalitySymbol( - const GlobalValue *GV, Mangler &Mang, const TargetMachine &TM, - MachineModuleInfo *MMI) const { - return TM.getTargetLowering()->getSymbol(GV, Mang); +MCSymbol *TargetLoweringObjectFile:: +getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang, + MachineModuleInfo *MMI) const { + return getSymbol(GV, Mang); } void TargetLoweringObjectFile::emitPersonalityValue(MCStreamer &Streamer, @@ -268,10 +275,6 @@ SectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang, return SelectSectionForGlobal(GV, Kind, Mang, TM); } -bool TargetLoweringObjectFile::isSectionAtomizableBySymbols( - const MCSection &Section) const { - return false; -} // Lame default implementation. Calculate the section name for global. const MCSection * @@ -309,11 +312,9 @@ TargetLoweringObjectFile::getSectionForConstant(SectionKind Kind) const { /// handling information. const MCExpr *TargetLoweringObjectFile::getTTypeGlobalReference( const GlobalValue *GV, unsigned Encoding, Mangler &Mang, - const TargetMachine &TM, MachineModuleInfo *MMI, - MCStreamer &Streamer) const { + MachineModuleInfo *MMI, MCStreamer &Streamer) const { const MCSymbolRefExpr *Ref = - MCSymbolRefExpr::Create(TM.getTargetLowering()->getSymbol(GV, Mang), - getContext()); + MCSymbolRefExpr::Create(getSymbol(GV, Mang), getContext()); return getTTypeReference(Ref, Encoding, Streamer); } |