[llvm-commits] [llvm] r98564 - in /llvm/trunk/lib/Target/X86: X86ISelLowering.cpp X86TargetObjectFile.cpp X86TargetObjectFile.h

Bill Wendling isanbard at gmail.com
Mon Mar 15 13:59:49 PDT 2010


Yes. :-) I'll clean it up later today.

-bw

On Mar 15, 2010, at 12:54 PM, Chris Lattner wrote:

> great! Can this move up to TargetLoweringObjectFileMachO now?
> 
> -Chris
> 
> On Mar 15, 2010, at 12:04 PM, Bill Wendling wrote:
> 
>> Author: void
>> Date: Mon Mar 15 14:04:37 2010
>> New Revision: 98564
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=98564&view=rev
>> Log:
>> Place the LSDA into the TEXT section for x86 Darwin. If the global it's pointing
>> to is local to the translation unit, we need to place fill the value of that
>> symbol into the non-lazy pointer.
>> 
>> This should conclude all Darwin changes for placing the LSDA into the TEXT
>> section. There is some cleanup to do. I.e., there's no longer a special need for
>> target-specific code here. But that can come later.
>> 
>> Modified:
>>   llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>>   llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp
>>   llvm/trunk/lib/Target/X86/X86TargetObjectFile.h
>> 
>> Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=98564&r1=98563&r2=98564&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Mon Mar 15 14:04:37 2010
>> @@ -70,53 +70,14 @@
>> static SDValue getMOVL(SelectionDAG &DAG, DebugLoc dl, EVT VT, SDValue V1,
>>                       SDValue V2);
>> 
>> -// FIXME: This is for a test.
>> -static cl::opt<bool>
>> -EnableX86EHTest("enable-x86-eh-test", cl::Hidden);
>> -
>> -namespace llvm {
>> -  class X86_test_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
>> -  public:
>> -    virtual void Initialize(MCContext &Ctx, const TargetMachine &TM) {
>> -      TargetLoweringObjectFileMachO::Initialize(Ctx, TM);
>> -
>> -      // Exception Handling.
>> -      LSDASection = getMachOSection("__TEXT", "__gcc_except_tab", 0,
>> -                                    SectionKind::getReadOnlyWithRel());
>> -    }
>> -
>> -    virtual unsigned getTTypeEncoding() const {
>> -      return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4;
>> -    }
>> -  };
>> -
>> -  class X8664_test_MachoTargetObjectFile : public X8664_MachoTargetObjectFile {
>> -  public:
>> -    virtual void Initialize(MCContext &Ctx, const TargetMachine &TM) {
>> -      TargetLoweringObjectFileMachO::Initialize(Ctx, TM);
>> -
>> -      // Exception Handling.
>> -      LSDASection = getMachOSection("__TEXT", "__gcc_except_tab", 0,
>> -                                    SectionKind::getReadOnlyWithRel());
>> -    }
>> -
>> -    virtual unsigned getTTypeEncoding() const {
>> -      return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4;
>> -    }
>> -  };
>> -}
>> -
>> static TargetLoweringObjectFile *createTLOF(X86TargetMachine &TM) {
>>  switch (TM.getSubtarget<X86Subtarget>().TargetType) {
>>  default: llvm_unreachable("unknown subtarget type");
>>  case X86Subtarget::isDarwin:
>> -    // FIXME: This is for an EH test.
>> -    if (EnableX86EHTest) {
>> -      if (TM.getSubtarget<X86Subtarget>().is64Bit())
>> -        return new X8664_test_MachoTargetObjectFile();
>> -      else
>> -        return new X86_test_MachoTargetObjectFile();
>> -    }
>> +    if (TM.getSubtarget<X86Subtarget>().is64Bit())
>> +      return new X8664_MachoTargetObjectFile();
>> +    else
>> +      return new X86_MachoTargetObjectFile();
>> 
>>    if (TM.getSubtarget<X86Subtarget>().is64Bit())
>>      return new X8664_MachoTargetObjectFile();
>> 
>> Modified: llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp?rev=98564&r1=98563&r2=98564&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp (original)
>> +++ llvm/trunk/lib/Target/X86/X86TargetObjectFile.cpp Mon Mar 15 14:04:37 2010
>> @@ -12,12 +12,26 @@
>> #include "X86TargetMachine.h"
>> #include "llvm/CodeGen/MachineModuleInfoImpls.h"
>> #include "llvm/MC/MCContext.h"
>> +#include "llvm/MC/MCSectionMachO.h"
>> #include "llvm/Target/Mangler.h"
>> #include "llvm/ADT/SmallString.h"
>> #include "llvm/Support/Dwarf.h"
>> using namespace llvm;
>> using namespace dwarf;
>> 
>> +void X86_MachoTargetObjectFile::Initialize(MCContext &Ctx,
>> +                                           const TargetMachine &TM) {
>> +  TargetLoweringObjectFileMachO::Initialize(Ctx, TM);
>> +
>> +  // Exception Handling.
>> +  LSDASection = getMachOSection("__TEXT", "__gcc_except_tab", 0,
>> +                                SectionKind::getReadOnlyWithRel());
>> +}
>> +
>> +unsigned X86_MachoTargetObjectFile::getTTypeEncoding() const {
>> +  return DW_EH_PE_indirect | DW_EH_PE_pcrel | DW_EH_PE_sdata4;
>> +}
>> +
>> const MCExpr *X8664_MachoTargetObjectFile::
>> getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
>>                               MachineModuleInfo *MMI, unsigned Encoding,
>> 
>> Modified: llvm/trunk/lib/Target/X86/X86TargetObjectFile.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetObjectFile.h?rev=98564&r1=98563&r2=98564&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/X86/X86TargetObjectFile.h (original)
>> +++ llvm/trunk/lib/Target/X86/X86TargetObjectFile.h Mon Mar 15 14:04:37 2010
>> @@ -17,11 +17,19 @@
>> namespace llvm {
>>  class X86TargetMachine;
>> 
>> -  /// X8664_MachoTargetObjectFile - This TLOF implementation is used for
>> -  /// Darwin/x86-64.
>> -  class X8664_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
>> +  /// X86_MachoTargetObjectFile - This TLOF implementation is used for Darwin
>> +  /// x86 variants.
>> +  class X86_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
>>  public:
>> +    virtual void Initialize(MCContext &Ctx, const TargetMachine &TM);
>> 
>> +    virtual unsigned getTTypeEncoding() const;
>> +  };
>> +
>> +  /// X8664_MachoTargetObjectFile - This TLOF implementation is used for Darwin
>> +  /// x86-64.
>> +  class X8664_MachoTargetObjectFile : public X86_MachoTargetObjectFile {
>> +  public:
>>    virtual const MCExpr *
>>    getExprForDwarfGlobalReference(const GlobalValue *GV, Mangler *Mang,
>>                                   MachineModuleInfo *MMI, unsigned Encoding,
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list