This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add hardware build attributes in assembler
ClosedPublic

Authored by olista01 on Apr 7 2017, 9:37 AM.

Details

Summary

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.

The LLVM part of this is at D31812.

Diff Detail

Repository
rL LLVM

Event Timeline

olista01 created this revision.Apr 7 2017, 9:37 AM
rengolin edited edge metadata.Apr 18 2017, 4:30 AM

Why do you need this to be passed through Clang? I thought this was just a debug/test tool to use llvm-mc, not an argument to actual code compilation.

I want to pass this through from clang (by default) when it is being used with an assembly file as input. My thinking is that "clang foo.s" is a user-facing tool, so they will want the automatic build attributes for selecting libraries, and detect conflicts between object files. On the other hand, "llvm-mc foo.s" is a developer and testing tool, so the extra build attributes would just be noise that is rarely relevant, as the generated object file probably isn't going to be linked.

rengolin accepted this revision.Apr 18 2017, 6:23 AM

Makes sense. LGTM. Thanks!

This revision is now accepted and ready to land.Apr 18 2017, 6:23 AM
This revision was automatically updated to reflect the committed changes.