aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 2606e9f..bd02408 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4355,6 +4355,11 @@ bool CompilerInvocation::CreateFromArgsImpl(
Res.getCodeGenOpts().Argv0 = Argv0;
Res.getCodeGenOpts().CommandLineArgs = CommandLineArgs;
+ if ((T.isOSBinFormatELF() || T.isOSBinFormatMachO()) &&
+ (Res.getLangOpts()->Exceptions || Res.getCodeGenOpts().UnwindTables ||
+ Res.getCodeGenOpts().getDebugInfo() != codegenoptions::NoDebugInfo))
+ Res.getPreprocessorOpts().addMacroDef("__GCC_HAVE_DWARF2_CFI_ASM=1");
+
Success &= FixupInvocation(Res, Diags, Args, DashX);
return Success;