mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Revert r201622 and r201608.
This causes the LLVMgold plugin to segfault. More information on the replies to r201608. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201669 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user