Constify a read-only parameter and give function a better name
This makes it clear that TargetInfo doesn't capture the LangOptions object,
rather uses it to apply adjustments.
llvm-svn: 212386
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp
index 055537b..be35e31 100644
--- a/clang/lib/Frontend/ASTUnit.cpp
+++ b/clang/lib/Frontend/ASTUnit.cpp
@@ -559,7 +559,7 @@
//
// FIXME: We shouldn't need to do this, the target should be immutable once
// created. This complexity should be lifted elsewhere.
- Target->setForcedLangOptions(LangOpt);
+ Target->adjust(LangOpt);
// Initialize the preprocessor.
PP.Initialize(*Target);
@@ -1077,7 +1077,7 @@
//
// FIXME: We shouldn't need to do this, the target should be immutable once
// created. This complexity should be lifted elsewhere.
- Clang->getTarget().setForcedLangOptions(Clang->getLangOpts());
+ Clang->getTarget().adjust(Clang->getLangOpts());
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");
@@ -1580,7 +1580,7 @@
//
// FIXME: We shouldn't need to do this, the target should be immutable once
// created. This complexity should be lifted elsewhere.
- Clang->getTarget().setForcedLangOptions(Clang->getLangOpts());
+ Clang->getTarget().adjust(Clang->getLangOpts());
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");
@@ -1841,7 +1841,7 @@
//
// FIXME: We shouldn't need to do this, the target should be immutable once
// created. This complexity should be lifted elsewhere.
- Clang->getTarget().setForcedLangOptions(Clang->getLangOpts());
+ Clang->getTarget().adjust(Clang->getLangOpts());
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");
@@ -2420,7 +2420,7 @@
//
// FIXME: We shouldn't need to do this, the target should be immutable once
// created. This complexity should be lifted elsewhere.
- Clang->getTarget().setForcedLangOptions(Clang->getLangOpts());
+ Clang->getTarget().adjust(Clang->getLangOpts());
assert(Clang->getFrontendOpts().Inputs.size() == 1 &&
"Invocation must have exactly one source file!");