aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-15 16:45:32 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-15 16:45:32 +0000
commit9a022bb007a3e77e1ac1330f955a239cfb1dd0fb (patch)
tree7b86255dc1214dfa9c742ce9e5ac52f5292cbcdf /include/clang
parentba1f04007baf376c5f5ccf7ef23588399942de7b (diff)
Teach TargetInfo to hold on to the TargetOptions with which it was
created. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Basic/TargetInfo.h11
-rw-r--r--include/clang/Frontend/ASTUnit.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index b73dcb49b5..3e63505dfa 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -62,6 +62,7 @@ enum TargetCXXABI {
/// \brief Exposes information about the current target.
///
class TargetInfo : public RefCountedBase<TargetInfo> {
+ TargetOptions *TargetOpts;
llvm::Triple Triple;
protected:
// Target values set by the ctor of the actual target implementation. Default
@@ -112,6 +113,16 @@ public:
virtual ~TargetInfo();
+ /// \brief Retrieve the target options.
+ TargetOptions &getTargetOpts() const {
+ assert(TargetOpts && "Missing target options");
+ return *TargetOpts;
+ }
+
+ void setTargetOpts(TargetOptions &TargetOpts) {
+ this->TargetOpts = &TargetOpts;
+ }
+
///===---- Target Data Type Query Methods -------------------------------===//
enum IntType {
NoInt = 0,
diff --git a/include/clang/Frontend/ASTUnit.h b/include/clang/Frontend/ASTUnit.h
index be46950fd3..0b02afa19d 100644
--- a/include/clang/Frontend/ASTUnit.h
+++ b/include/clang/Frontend/ASTUnit.h
@@ -24,6 +24,7 @@
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/FileSystemOptions.h"
+#include "clang/Basic/TargetOptions.h"
#include "clang-c/Index.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/OwningPtr.h"
@@ -71,6 +72,7 @@ private:
IntrusiveRefCntPtr<Preprocessor> PP;
IntrusiveRefCntPtr<ASTContext> Ctx;
ASTReader *Reader;
+ TargetOptions TargetOpts;
struct ASTWriterData;
OwningPtr<ASTWriterData> WriterData;