From bc10b9fbc5b00bcef08cbabecf1522eedf4f818f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 15 Oct 2012 16:45:32 +0000 Subject: Teach TargetInfo to hold on to the TargetOptions with which it was created. llvm-svn: 165943 --- clang/lib/Basic/TargetInfo.cpp | 3 ++- clang/lib/Basic/Targets.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Basic') 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)) { -- cgit v1.2.3