diff options
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CGBuiltin.cpp | 15 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 8 | ||||
-rw-r--r-- | clang/lib/CodeGen/ModuleBuilder.cpp | 13 |
4 files changed, 8 insertions, 35 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp index 37435cd8150..df6ac7fc243 100644 --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -21,9 +21,6 @@ #include "clang/Basic/TargetBuiltins.h" #include "llvm/Intrinsics.h" #include "llvm/Target/TargetData.h" -#include "llvm/Target/TargetLowering.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetRegisterInfo.h" using namespace clang; using namespace CodeGen; using namespace llvm; @@ -410,18 +407,6 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD, Value *F = CGM.getIntrinsic(Intrinsic::eh_unwind_init, 0, 0); return RValue::get(Builder.CreateCall(F)); } - case Builtin::BI__builtin_dwarf_sp_column: { - const llvm::TargetMachine &Machine = CGM.getTargetMachine(); - llvm::TargetLowering *TL = Machine.getTargetLowering(); - assert(TL && "need lowering to codegen __builtin_dwarf_sp_column"); - const llvm::TargetRegisterInfo *TRI = Machine.getRegisterInfo(); - assert(TRI && "need register info to codegen __builtin_dwarf_sp_column"); - unsigned SP = TL->getStackPointerRegisterToSaveRestore(); - int DwarfSP = TRI->getDwarfRegNum(SP, /*for EH*/ true); - - return RValue::get( - llvm::ConstantInt::getSigned(cast<IntegerType>(LLVMIntTy), DwarfSP)); - } case Builtin::BI__builtin_extend_pointer: { // Extends a pointer to the size of an _Unwind_Word, which is // uint64_t on all platforms. Generally this gets poked into a diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 89e6490be35..bc2bd6c882d 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -40,12 +40,11 @@ using namespace CodeGen; CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO, - llvm::Module &M, const llvm::TargetMachine &TM, - const llvm::TargetData &TD, Diagnostic &diags) + llvm::Module &M, const llvm::TargetData &TD, + Diagnostic &diags) : BlockModule(C, M, TD, Types, *this), Context(C), Features(C.getLangOptions()), CodeGenOpts(CGO), TheModule(M), - TheTargetMachine(TM), TheTargetData(TD), TheTargetCodeGenInfo(0), - Diags(diags), + TheTargetData(TD), TheTargetCodeGenInfo(0), Diags(diags), Types(C, M, TD, getTargetCodeGenInfo().getABIInfo()), MangleCtx(C), VtableInfo(*this), Runtime(0), MemCpyFn(0), MemMoveFn(0), MemSetFn(0), CFConstantStringClassRef(0), diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 8b9a0f29c78..ac8332647b7 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -38,7 +38,6 @@ namespace llvm { class Function; class GlobalValue; class TargetData; - class TargetMachine; class FunctionType; class LLVMContext; } @@ -87,7 +86,6 @@ class CodeGenModule : public BlockModule { const LangOptions &Features; const CodeGenOptions &CodeGenOpts; llvm::Module &TheModule; - const llvm::TargetMachine &TheTargetMachine; const llvm::TargetData &TheTargetData; mutable const TargetCodeGenInfo *TheTargetCodeGenInfo; Diagnostic &Diags; @@ -170,8 +168,7 @@ class CodeGenModule : public BlockModule { llvm::LLVMContext &VMContext; public: CodeGenModule(ASTContext &C, const CodeGenOptions &CodeGenOpts, - llvm::Module &M, const llvm::TargetMachine &TM, - const llvm::TargetData &TD, Diagnostic &Diags); + llvm::Module &M, const llvm::TargetData &TD, Diagnostic &Diags); ~CodeGenModule(); @@ -201,9 +198,6 @@ public: const llvm::TargetData &getTargetData() const { return TheTargetData; } llvm::LLVMContext &getLLVMContext() { return VMContext; } const TargetCodeGenInfo &getTargetCodeGenInfo() const; - const llvm::TargetMachine &getTargetMachine() const { - return TheTargetMachine; - } /// getDeclVisibilityMode - Compute the visibility of the decl \arg D. LangOptions::VisibilityMode getDeclVisibilityMode(const Decl *D) const; diff --git a/clang/lib/CodeGen/ModuleBuilder.cpp b/clang/lib/CodeGen/ModuleBuilder.cpp index 4ae18bbb14a..1e1edc1c482 100644 --- a/clang/lib/CodeGen/ModuleBuilder.cpp +++ b/clang/lib/CodeGen/ModuleBuilder.cpp @@ -29,7 +29,6 @@ namespace { class CodeGeneratorImpl : public CodeGenerator { Diagnostic &Diags; llvm::OwningPtr<const llvm::TargetData> TD; - const llvm::TargetMachine &TM; ASTContext *Ctx; const CodeGenOptions CodeGenOpts; // Intentionally copied in. protected: @@ -37,11 +36,8 @@ namespace { llvm::OwningPtr<CodeGen::CodeGenModule> Builder; public: CodeGeneratorImpl(Diagnostic &diags, const std::string& ModuleName, - const CodeGenOptions &CGO, - const llvm::TargetMachine &TM, - llvm::LLVMContext& C) - : Diags(diags), TM(TM), CodeGenOpts(CGO), - M(new llvm::Module(ModuleName, C)) {} + const CodeGenOptions &CGO, llvm::LLVMContext& C) + : Diags(diags), CodeGenOpts(CGO), M(new llvm::Module(ModuleName, C)) {} virtual ~CodeGeneratorImpl() {} @@ -60,7 +56,7 @@ namespace { M->setDataLayout(Ctx->Target.getTargetDescription()); TD.reset(new llvm::TargetData(Ctx->Target.getTargetDescription())); Builder.reset(new CodeGen::CodeGenModule(Context, CodeGenOpts, - *M, TM, *TD, Diags)); + *M, *TD, Diags)); } virtual void HandleTopLevelDecl(DeclGroupRef DG) { @@ -99,7 +95,6 @@ namespace { CodeGenerator *clang::CreateLLVMCodeGen(Diagnostic &Diags, const std::string& ModuleName, const CodeGenOptions &CGO, - const llvm::TargetMachine &Machine, llvm::LLVMContext& C) { - return new CodeGeneratorImpl(Diags, ModuleName, CGO, Machine, C); + return new CodeGeneratorImpl(Diags, ModuleName, CGO, C); } |