mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
MC: Allow modifiers in MCSymbolRefExpr, and eliminate X86MCTargetExpr.
- Although it would be nice to allow this decoupling, the assembler needs to be able to reason about MCSymbolRefExprs in too many places to make this viable. We can use a target specific encoding of the variant if this becomes an issue. - This patch also extends llvm-mc to support parsing of the modifiers, as opposed to lumping them in with the symbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98592 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "X86MCTargetExpr.h"
|
||||
#include "X86TargetObjectFile.h"
|
||||
#include "X86TargetMachine.h"
|
||||
#include "llvm/CodeGen/MachineModuleInfoImpls.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/Target/Mangler.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
@@ -29,7 +29,7 @@ getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
|
||||
if (Encoding & (DW_EH_PE_indirect | DW_EH_PE_pcrel)) {
|
||||
const MCSymbol *Sym = Mang->getSymbol(GV);
|
||||
const MCExpr *Res =
|
||||
X86MCTargetExpr::Create(Sym, X86MCTargetExpr::GOTPCREL, getContext());
|
||||
MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_GOTPCREL, getContext());
|
||||
const MCExpr *Four = MCConstantExpr::Create(4, getContext());
|
||||
return MCBinaryExpr::CreateAdd(Res, Four, getContext());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user