summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorMark Lacey <mark.lacey@apple.com>2013-12-05 01:23:01 +0000
committerMark Lacey <mark.lacey@apple.com>2013-12-05 01:23:01 +0000
commitd33ff74b196c38ff414773d39899514a9c9dd8ed (patch)
tree4b9ee692ffb010c8e80a51de00b107a02fc661e6 /clang
parent164097a6eb09ca50828b0a62d7b0c7f8bb223cc2 (diff)
downloadbcm5719-llvm-d33ff74b196c38ff414773d39899514a9c9dd8ed.tar.gz
bcm5719-llvm-d33ff74b196c38ff414773d39899514a9c9dd8ed.zip
Simplify the constructor to CodeGenABITypes.
The CodeGenOptions are not used for ABI type selection, so we will just create one with the default constructor (there is a FloatABI option in CodeGenOptions that is passed on to LLVM, but not used in Clang for LLVM IR type generation). We can use the DiagnosticsEngine on the ASTContext rather than making a client pass one in explicitly. llvm-svn: 196450
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/CodeGen/CodeGenABITypes.h11
-rw-r--r--clang/lib/CodeGen/CodeGenABITypes.cpp9
2 files changed, 12 insertions, 8 deletions
diff --git a/clang/include/clang/CodeGen/CodeGenABITypes.h b/clang/include/clang/CodeGen/CodeGenABITypes.h
index 81e2cdc1901..0cefef3d57a 100644
--- a/clang/include/clang/CodeGen/CodeGenABITypes.h
+++ b/clang/include/clang/CodeGen/CodeGenABITypes.h
@@ -47,10 +47,7 @@ class CodeGenModule;
class CodeGenABITypes
{
public:
- CodeGenABITypes(ASTContext &C, const CodeGenOptions &CodeGenOpts,
- llvm::Module &M, const llvm::DataLayout &TD,
- DiagnosticsEngine &Diags);
-
+ CodeGenABITypes(ASTContext &C, llvm::Module &M, const llvm::DataLayout &TD);
~CodeGenABITypes();
/// These methods all forward to methods in the private implementation class
@@ -71,6 +68,12 @@ public:
RequiredArgs args);
private:
+ /// Default CodeGenOptions object used to initialize the
+ /// CodeGenModule and otherwise not used. More specifically, it is
+ /// not used in ABI type generation, so none of the options matter.
+ CodeGenOptions *CGO;
+
+ /// The CodeGenModule we use get to the CodeGenTypes object.
CodeGen::CodeGenModule *CGM;
};
diff --git a/clang/lib/CodeGen/CodeGenABITypes.cpp b/clang/lib/CodeGen/CodeGenABITypes.cpp
index 18c836cf2f4..d78b47bfb61 100644
--- a/clang/lib/CodeGen/CodeGenABITypes.cpp
+++ b/clang/lib/CodeGen/CodeGenABITypes.cpp
@@ -19,21 +19,22 @@
#include "clang/CodeGen/CodeGenABITypes.h"
#include "clang/CodeGen/CGFunctionInfo.h"
+#include "clang/Frontend/CodeGenOptions.h"
#include "CodeGenModule.h"
using namespace clang;
using namespace CodeGen;
CodeGenABITypes::CodeGenABITypes(ASTContext &C,
- const CodeGenOptions &CodeGenOpts,
llvm::Module &M,
- const llvm::DataLayout &TD,
- DiagnosticsEngine &Diags)
- : CGM(new CodeGen::CodeGenModule(C, CodeGenOpts, M, TD, Diags)) {
+ const llvm::DataLayout &TD)
+ : CGO(new CodeGenOptions),
+ CGM(new CodeGen::CodeGenModule(C, *CGO, M, TD, C.getDiagnostics())) {
}
CodeGenABITypes::~CodeGenABITypes()
{
+ delete CGO;
delete CGM;
}
OpenPOWER on IntegriCloud