This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Pass thumb as architecture to the underlying tools, when targeting windows
ClosedPublic

Authored by mstorsjo on Jul 27 2016, 5:13 AM.

Details

Reviewers
rengolin
Summary

This makes sure that the thumb section flag gets set by the assembler.

This is an alternative fix to D22776.

Diff Detail

Event Timeline

mstorsjo updated this revision to Diff 65709.Jul 27 2016, 5:13 AM
mstorsjo retitled this revision from to [ARM] Pass thumb as architecture to the underlying tools, when targeting windows.
mstorsjo updated this object.
mstorsjo added a subscriber: cfe-commits.
rengolin accepted this revision.Jul 27 2016, 5:58 AM
rengolin added a reviewer: rengolin.

LGTM. I'll add the test to LLVM as a separate commit.

lib/Driver/ToolChain.cpp
499

This makes sense to me.

test/Driver/thumb-attributes.s
1 ↗(On Diff #65709)

But we don't usually do asm tests in Clang. I can add this test to LLVM's MC dir.

This revision is now accepted and ready to land.Jul 27 2016, 5:58 AM
mstorsjo added inline comments.Jul 27 2016, 6:07 AM
test/Driver/thumb-attributes.s
1 ↗(On Diff #65709)

Do tests there also use the clang frontend driver? If you change it to test with llvm-mc with a thumb triplet, you won't actually test anything of this.

(Also, as long as this test uses clang, should it perhaps need a "// REQUIRES: arm-registered-target" at the start? I had that included in the other clang test, which was based on other old tests, while this one was changed from llvm-mc to clang.)

rengolin added inline comments.Jul 27 2016, 6:21 AM
test/Driver/thumb-attributes.s
1 ↗(On Diff #65709)

If you change it to test with llvm-mc with a thumb triplet, you won't actually test anything of this.

That's a good point, actually. A better test for this one thing would be to make sure that whatever C file would generate an IR with a triple that is actually "thumb".

mstorsjo updated this revision to Diff 65725.Jul 27 2016, 6:32 AM
mstorsjo edited edge metadata.

Updated the test to only check what triplet is passed to the assembler

rengolin closed this revision.Jul 27 2016, 7:20 AM

Committed as r276869.