mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
add an x86 implementation of MCTargetExpr for
representing @GOT and friends. Use it for personality references as a first use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95588 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "X86TargetObjectFile.h"
|
||||
#include "X86MCTargetExpr.h"
|
||||
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/Target/Mangler.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
using namespace llvm;
|
||||
@@ -57,9 +57,9 @@ getSymbolForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
|
||||
SmallString<128> Name;
|
||||
Mang->getNameWithPrefix(Name, GV, false);
|
||||
Name += "@GOTPCREL";
|
||||
const MCSymbol *Sym = getContext().CreateSymbol(Name);
|
||||
const MCExpr *Res =
|
||||
MCSymbolRefExpr::Create(Name.str(), getContext());
|
||||
X86MCTargetExpr::Create(Sym, X86MCTargetExpr::GOTPCREL, getContext());
|
||||
const MCExpr *Four = MCConstantExpr::Create(4, getContext());
|
||||
return MCBinaryExpr::CreateAdd(Res, Four, getContext());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user