diff options
author | Ted Kremenek <kremenek@apple.com> | 2013-03-11 20:51:52 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2013-03-11 20:51:52 +0000 |
commit | ebf0f43f07e2fdc0e35554afb38f41c8be314b02 (patch) | |
tree | e475d5c708a9564f41867feace5b0694674caf98 /lib/Driver/Tools.cpp | |
parent | ebbd7e07aa0f22722da6ed8dd3a55beed9699171 (diff) |
Disallow using -fmodules with -no-integrated-as.
Modules enables features such as auto-linking, and we simply do not want to
support a matrix of subtly enabled/disabled features depending on whether or
not a user is using the integrated assembler.
It isn't clear if this is the best place to do this check. For one thing,
these kind of errors are not caught by the serialized diagnostics.
Fixes <rdar://problem/13289240>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176826 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 62b1febd52..ef759ff6d3 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1429,12 +1429,18 @@ static bool ShouldDisableCFI(const ArgList &Args, Default); } -static bool ShouldDisableDwarfDirectory(const ArgList &Args, - const ToolChain &TC) { +static bool ShouldUseIntegratedAssembler(const ArgList &Args, + const ToolChain &TC) { bool IsIADefault = TC.IsIntegratedAssemblerDefault(); bool UseIntegratedAs = Args.hasFlag(options::OPT_integrated_as, options::OPT_no_integrated_as, IsIADefault); + return UseIntegratedAs; +} + +static bool ShouldDisableDwarfDirectory(const ArgList &Args, + const ToolChain &TC) { + bool UseIntegratedAs = ShouldUseIntegratedAssembler(Args, TC); bool UseDwarfDirectory = Args.hasFlag(options::OPT_fdwarf_directory_asm, options::OPT_fno_dwarf_directory_asm, UseIntegratedAs); @@ -2778,6 +2784,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-fmodules"); HaveModules = true; } + + if (HaveModules && !ShouldUseIntegratedAssembler(Args, getToolChain())) { + D.Diag(diag::err_drv_modules_integrated_as); + D.Diag(diag::note_drv_modules_integrated_as); + return; + } } // If a module path was provided, pass it along. Otherwise, use a temporary |