| Index: src/IceTargetLoweringX8632Traits.h
|
| diff --git a/src/IceTargetLoweringX8632Traits.h b/src/IceTargetLoweringX8632Traits.h
|
| index d02f69a1d7c02076b441b877c5fecf48a5864241..24032acc9f0ece0bc613d3c818bd44c151ddaacc 100644
|
| --- a/src/IceTargetLoweringX8632Traits.h
|
| +++ b/src/IceTargetLoweringX8632Traits.h
|
| @@ -72,8 +72,10 @@ template <> struct MachineTraits<TargetX8632> {
|
| static const SizeT FramePtr = RegX8632::Reg_ebp;
|
| static const GPRRegister Encoded_Reg_Accumulator = RegX8632::Encoded_Reg_eax;
|
| static const GPRRegister Encoded_Reg_Counter = RegX8632::Encoded_Reg_ecx;
|
| - static const FixupKind PcRelFixup = llvm::ELF::R_386_PC32;
|
| - static const FixupKind RelFixup = llvm::ELF::R_386_32;
|
| + static constexpr FixupKind FK_PcRel = llvm::ELF::R_386_PC32;
|
| + static constexpr FixupKind FK_Abs = llvm::ELF::R_386_32;
|
| + static constexpr FixupKind FK_Gotoff = llvm::ELF::R_386_GOTOFF;
|
| + static constexpr FixupKind FK_GotPC = llvm::ELF::R_386_GOTPC;
|
|
|
| class Operand {
|
| public:
|
| @@ -737,9 +739,10 @@ template <> struct MachineTraits<TargetX8632> {
|
| static X86OperandMem *create(Cfg *Func, Type Ty, Variable *Base,
|
| Constant *Offset, Variable *Index = nullptr,
|
| uint16_t Shift = 0,
|
| - SegmentRegisters SegmentReg = DefaultSegment) {
|
| - return new (Func->allocate<X86OperandMem>())
|
| - X86OperandMem(Func, Ty, Base, Offset, Index, Shift, SegmentReg);
|
| + SegmentRegisters SegmentReg = DefaultSegment,
|
| + bool IsPIC = false) {
|
| + return new (Func->allocate<X86OperandMem>()) X86OperandMem(
|
| + Func, Ty, Base, Offset, Index, Shift, SegmentReg, IsPIC);
|
| }
|
| Variable *getBase() const { return Base; }
|
| Constant *getOffset() const { return Offset; }
|
| @@ -747,6 +750,8 @@ template <> struct MachineTraits<TargetX8632> {
|
| uint16_t getShift() const { return Shift; }
|
| SegmentRegisters getSegmentRegister() const { return SegmentReg; }
|
| void emitSegmentOverride(Assembler *Asm) const;
|
| + void setIsPIC() { IsPIC = true; }
|
| + bool getIsPIC() const { return IsPIC; }
|
| Address toAsmAddress(Assembler *Asm,
|
| const Ice::TargetLowering *Target) const;
|
|
|
| @@ -764,17 +769,19 @@ template <> struct MachineTraits<TargetX8632> {
|
|
|
| private:
|
| X86OperandMem(Cfg *Func, Type Ty, Variable *Base, Constant *Offset,
|
| - Variable *Index, uint16_t Shift, SegmentRegisters SegmentReg);
|
| + Variable *Index, uint16_t Shift, SegmentRegisters SegmentReg,
|
| + bool IsPIC);
|
|
|
| Variable *Base;
|
| Constant *Offset;
|
| Variable *Index;
|
| uint16_t Shift;
|
| SegmentRegisters SegmentReg : 16;
|
| + bool IsPIC;
|
| /// A flag to show if this memory operand is a randomized one. Randomized
|
| /// memory operands are generated in
|
| /// TargetX86Base::randomizeOrPoolImmediate()
|
| - bool Randomized;
|
| + bool Randomized = false;
|
| };
|
|
|
| /// VariableSplit is a way to treat an f64 memory location as a pair of i32
|
|
|