[PATCH] D34682: [Triple] Add isThumb and isARM functions NFCI.

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 15:22:19 PDT 2017


rengolin added inline comments.


================
Comment at: lib/Target/ARM/ARMAsmPrinter.cpp:480
+  bool isThumb = TT.isThumb() ||
                  TT.getSubArch() == Triple::ARMSubArch_v7m ||
                  TT.getSubArch() == Triple::ARMSubArch_v6m;
----------------
javed.absar wrote:
> fhahn wrote:
> > I am slightly worried about those checks here. Should isThumb() return true for all M profile CPUs as they only support thumb-mode? Also, it seems that v8m is missing from this check.
> Yes I think isMClass would suffice. 
There are other patches that are taking care of not allowing ARM+M-class, but there is nothing in Triple that explicitly forbids it, and people can still use directives and attributes to have files emit ARM code in an M-class object file with the guarantee that it will never be executed.

I think you can only make M-class == Thumb by default if you guarantee when creating the Triple class that it'll be impossible to create an ARM+M Triple, which in turn will make the M-class check redundant.

I'm curious as to what kind of problem was "fixed" by the additional check and how can we fix it properly instead.


https://reviews.llvm.org/D34682





More information about the llvm-commits mailing list