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

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 1 08:27:47 PDT 2018


peter.smith added a comment.

I don't have any better suggestions about where to move the function right now. I have a couple of minor suggestions.



================
Comment at: include/llvm/Target/TargetMachine.h:359
+getEffectiveCodeModel(Optional<CodeModel::Model> CM,
+                      CodeModel::Model Default = CodeModel::Small) {
+  if (CM) {
----------------
I have a mild personal preference not to use a default parameter here, in other words pass in default code model for all callers and not just Lanai and WebAssembly. CodeModel::Small is by far the most common but I think it makes it easier to see what the default is from the individual backend without having to go up a few levels.

Not a strong opinion, so feel free to ignore.


================
Comment at: include/llvm/Target/TargetMachine.h:361
+  if (CM) {
+    if (*CM == CodeModel::Tiny)
+      report_fatal_error("Target does not support the Tiny CodeModel");
----------------
Is it worth checking that the Kernel code model is not supported as well? As far as I can tell this is only supported on AArch64. Admittedly it looks like the chances of someone using that by mistake is much lower than CodeModel::Tiny 


https://reviews.llvm.org/D50141





More information about the llvm-commits mailing list