aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2020-08-16 21:49:13 -0700
committerYonghong Song <yhs@fb.com>2020-08-16 21:53:37 -0700
commit000ad1a976a537256b17788dcf8b50ca117007b8 (patch)
treecc36ed1ce87e2cd085f1588e3bc1f0896a621ff7 /clang/lib/Frontend/CompilerInvocation.cpp
parentfcd2969da9e04a70103bfbf8a382c0842fcf6aaf (diff)
downloadllvm-000ad1a976a537256b17788dcf8b50ca117007b8.zip
llvm-000ad1a976a537256b17788dcf8b50ca117007b8.tar.gz
llvm-000ad1a976a537256b17788dcf8b50ca117007b8.tar.bz2
[clang] fix a compilation bug
With gcc 6.3.0, I hit the following compilation bug: /home/yhs/work/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp: In function ‘bool ParseCodeGenArgs(clang::CodeGenOptions&, llvm::opt::ArgList&, clang::InputKind, clang::DiagnosticsEngine&, const clang::TargetOptions&, const clang::FrontendOptions&)’: /home/yhs/work/llvm-project/clang/lib/Frontend/CompilerInvocation.cpp:780:12: error: unused variable ‘A’ [-Werror=unused-variable] if (Arg *A = Args.getLastArg(OPT_fuse_ctor_homing)) ^ cc1plus: all warnings being treated as errors The bug is introduced by Commit ae6523cd62a4 ("[DebugInfo] Add -fuse-ctor-homing cc1 flag so we can turn on constructor homing only if limited debug info is already on.")
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 86504ed..3b69eef 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -777,7 +777,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
}
// If -fuse-ctor-homing is set and limited debug info is already on, then use
// constructor homing.
- if (Arg *A = Args.getLastArg(OPT_fuse_ctor_homing))
+ if (Args.getLastArg(OPT_fuse_ctor_homing))
if (Opts.getDebugInfo() == codegenoptions::LimitedDebugInfo)
Opts.setDebugInfo(codegenoptions::DebugInfoConstructor);