aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-08-31 13:44:31 -0700
committerJan Svoboda <jan_svoboda@apple.com>2023-09-05 13:23:53 -0700
commit5746002ebb9c3d02be408edf13c2edc39aecf591 (patch)
treeba7475fabaf14d59464135814c4c4af863ff70b3 /clang/lib/Frontend/CompilerInvocation.cpp
parentb0cbf3a0dac51d426dd38c307f745e74f409aed7 (diff)
downloadllvm-5746002ebb9c3d02be408edf13c2edc39aecf591.zip
llvm-5746002ebb9c3d02be408edf13c2edc39aecf591.tar.gz
llvm-5746002ebb9c3d02be408edf13c2edc39aecf591.tar.bz2
[clang] NFCI: Change returned LanguageOptions pointer to reference
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 4b821d1..e9e2445 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -135,7 +135,7 @@ CompilerInvocationRefBase::CompilerInvocationRefBase()
CompilerInvocationRefBase::CompilerInvocationRefBase(
const CompilerInvocationRefBase &X)
- : LangOpts(new LangOptions(*X.getLangOpts())),
+ : LangOpts(new LangOptions(X.getLangOpts())),
TargetOpts(new TargetOptions(X.getTargetOpts())),
DiagnosticOpts(new DiagnosticOptions(X.getDiagnosticOpts())),
HeaderSearchOpts(new HeaderSearchOptions(X.getHeaderSearchOpts())),
@@ -461,7 +461,7 @@ static bool FixupInvocation(CompilerInvocation &Invocation,
InputKind IK) {
unsigned NumErrorsBefore = Diags.getNumErrors();
- LangOptions &LangOpts = *Invocation.getLangOpts();
+ LangOptions &LangOpts = Invocation.getLangOpts();
CodeGenOptions &CodeGenOpts = Invocation.getCodeGenOpts();
TargetOptions &TargetOpts = Invocation.getTargetOpts();
FrontendOptions &FrontendOpts = Invocation.getFrontendOpts();
@@ -4365,7 +4365,7 @@ bool CompilerInvocation::CreateFromArgsImpl(
unsigned MissingArgIndex, MissingArgCount;
InputArgList Args = Opts.ParseArgs(CommandLineArgs, MissingArgIndex,
MissingArgCount, VisibilityMask);
- LangOptions &LangOpts = *Res.getLangOpts();
+ LangOptions &LangOpts = Res.getLangOpts();
// Check for missing argument error.
if (MissingArgCount)
@@ -4446,7 +4446,7 @@ bool CompilerInvocation::CreateFromArgsImpl(
// If sanitizer is enabled, disable OPT_ffine_grained_bitfield_accesses.
if (Res.getCodeGenOpts().FineGrainedBitfieldAccesses &&
- !Res.getLangOpts()->Sanitize.empty()) {
+ !Res.getLangOpts().Sanitize.empty()) {
Res.getCodeGenOpts().FineGrainedBitfieldAccesses = false;
Diags.Report(diag::warn_drv_fine_grained_bitfield_accesses_ignored);
}
@@ -4617,12 +4617,12 @@ std::vector<std::string> CompilerInvocation::getCC1CommandLine() const {
}
void CompilerInvocation::resetNonModularOptions() {
- getLangOpts()->resetNonModularOptions();
+ getLangOpts().resetNonModularOptions();
getPreprocessorOpts().resetNonModularOptions();
}
void CompilerInvocation::clearImplicitModuleBuildOptions() {
- getLangOpts()->ImplicitModules = false;
+ getLangOpts().ImplicitModules = false;
getHeaderSearchOpts().ImplicitModuleMaps = false;
getHeaderSearchOpts().ModuleCachePath.clear();
getHeaderSearchOpts().ModulesValidateOncePerBuildSession = false;