diff options
author | John McCall <rjmccall@apple.com> | 2010-03-04 00:23:29 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-04 00:23:29 +0000 |
commit | c9fe644675503894e9e76e8ecd8e6519426548de (patch) | |
tree | ff130be72fa30cac9af308e4eedb57d8c647d818 /lib/CodeGen/CodeGenModule.h | |
parent | 5fccd36204f11c8491325038e6ffcc784399098e (diff) |
Create a TargetMachine whenever we create a CodeGenAction. The codegen of
some builtins will rely on target knowledge.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index ac8332647b..8b9a0f29c7 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -38,6 +38,7 @@ namespace llvm { class Function; class GlobalValue; class TargetData; + class TargetMachine; class FunctionType; class LLVMContext; } @@ -86,6 +87,7 @@ 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; @@ -168,7 +170,8 @@ class CodeGenModule : public BlockModule { llvm::LLVMContext &VMContext; public: CodeGenModule(ASTContext &C, const CodeGenOptions &CodeGenOpts, - llvm::Module &M, const llvm::TargetData &TD, Diagnostic &Diags); + llvm::Module &M, const llvm::TargetMachine &TM, + const llvm::TargetData &TD, Diagnostic &Diags); ~CodeGenModule(); @@ -198,6 +201,9 @@ 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; |