summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
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
commitbc10b9fbc5b00bcef08cbabecf1522eedf4f818f (patch)
tree57f43c36e88dcb11200ce5d20cf628496212514d /clang/lib/Basic
parent4bb926d91dbd9842c20dbeb0d6abea7dee36e1fa (diff)
downloadbcm5719-llvm-bc10b9fbc5b00bcef08cbabecf1522eedf4f818f.tar.gz
bcm5719-llvm-bc10b9fbc5b00bcef08cbabecf1522eedf4f818f.zip
Teach TargetInfo to hold on to the TargetOptions with which it was
created. llvm-svn: 165943
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/TargetInfo.cpp3
-rw-r--r--clang/lib/Basic/Targets.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp
index db5941a5d92..b89b18b3aea 100644
--- a/clang/lib/Basic/TargetInfo.cpp
+++ b/clang/lib/Basic/TargetInfo.cpp
@@ -24,7 +24,8 @@ using namespace clang;
static const LangAS::Map DefaultAddrSpaceMap = { 0 };
// TargetInfo Constructor.
-TargetInfo::TargetInfo(const std::string &T) : Triple(T) {
+TargetInfo::TargetInfo(const std::string &T) : TargetOpts(), Triple(T)
+{
// Set defaults. Defaults are set for a 32-bit RISC platform, like PPC or
// SPARC. These should be overridden by concrete targets as needed.
BigEndian = true;
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 76e09a55f4e..79239d0bcf6 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -4603,6 +4603,7 @@ TargetInfo *TargetInfo::CreateTargetInfo(DiagnosticsEngine &Diags,
Diags.Report(diag::err_target_unknown_triple) << Triple.str();
return 0;
}
+ Target->setTargetOpts(Opts);
// Set the target CPU if specified.
if (!Opts.CPU.empty() && !Target->setCPU(Opts.CPU)) {
OpenPOWER on IntegriCloud