diff options
author | Oliver Stannard <oliver.stannard@arm.com> | 2017-04-18 13:21:05 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@arm.com> | 2017-04-18 13:21:05 +0000 |
commit | 692dc54b0ddece06fd1c78aee32ce60719f8da20 (patch) | |
tree | b1ac22eed98b6c96972d87fd2513506542151258 /clang/lib/Driver/ToolChains/Clang.cpp | |
parent | 233310f3e602bdc076a5a82665517df8ce5aae94 (diff) | |
download | bcm5719-llvm-692dc54b0ddece06fd1c78aee32ce60719f8da20.tar.gz bcm5719-llvm-692dc54b0ddece06fd1c78aee32ce60719f8da20.zip |
[ARM] Add hardware build attributes in assembler
This passes an option to the ARM assembly parser to emit build
attributes for the hardware selected by command line options, when
assembling an assembly file.
This is not enabled for C/C++, as this would result in duplicate build
attribute directives being emitted in each inline assembly block, when
emitting assembly.
This also adds an option to allow disabling this behaviour for assembly
files, for users who were relying on the old behaviour.
Differential revision: https://reviews.llvm.org/D31813
llvm-svn: 300550
Diffstat (limited to 'clang/lib/Driver/ToolChains/Clang.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Clang.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index f8eeeb4eef6..4259b629728 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4996,6 +4996,19 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, case llvm::Triple::x86_64: AddX86TargetArgs(Args, CmdArgs); break; + + case llvm::Triple::arm: + case llvm::Triple::armeb: + case llvm::Triple::thumb: + case llvm::Triple::thumbeb: + // This isn't in AddARMTargetArgs because we want to do this for assembly + // only, not C/C++. + if (Args.hasFlag(options::OPT_mdefault_build_attributes, + options::OPT_mno_default_build_attributes, true)) { + CmdArgs.push_back("-mllvm"); + CmdArgs.push_back("-arm-add-build-attributes"); + } + break; } // Consume all the warning flags. Usually this would be handled more |