[PATCH] D50141: Add errors for tiny codemodel on targets other than AArch64

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 07:08:32 PST 2018


asb added a comment.
Herald added a subscriber: jsji.

This seems a positive improvement and I don't want to bikeshed it too much, but it does feel a bit arbitrary to reject tiny and kernel codemodels in getEffectiveCodeModel. You could imagine having a virtual `isSupportedCodeModel`. Might be more hassle than it's worth though...



================
Comment at: include/llvm/Target/TargetMachine.h:355-357
+/// Helper method for getting the code model, returning Default if
+/// CM does not have a value. The tiny and kernel models will produce
+/// an error.
----------------
What about adding something explicit such as: "Targets which support the tiny/kernel code models or require more complex code model selection logic should implement and call their own variant of this function."?

Makes it clear to anyone looking at it that there's not an extension point they're missing - the intended approach is just to go and implement your own version.


https://reviews.llvm.org/D50141





More information about the llvm-commits mailing list