[PATCH] D33287: [Linker] Add support for linking ARM and Thumb IR modules.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 05:57:25 PDT 2017


tejohnson added inline comments.


================
Comment at: lib/Linker/IRMover.cpp:1275
+// Add thumb-mode to target-features if we link ARM and Thumb code together.
+void maybeAddARMSubtargetFeatures(const Triple &SrcTriple,
+                                  const Triple &DstTriple,
----------------
If we're going to do this in the IRMover, it would probably be more efficient to do this once over the whole source module, not just the symbols being linked in one by one, so that the checking etc only needs to be done once per module. Just walk over all the src module functions and apply the attribute.

I guess this is needed because it looks like thumb-mode is typically added in the MC time, but that is too late since these modules are already combined, right?

Is there a drawback to always adding the +/-thumb-mode attribute to thumb/arm modules earlier, like during clang CodeGen?


https://reviews.llvm.org/D33287





More information about the llvm-commits mailing list