[PATCH] D30791: Add support for -fno-builtin to LTO and ThinLTO on Darwin

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 10 07:45:29 PST 2017


tejohnson added a comment.

It looks like this is part of the required fix for PR30403? I guess the other part is to add the module flag to be set during the FE, and use that to set this flag?

It would be good to add support in the new LTO API too.

In the discussion on PR30403 it sounds like the desired behavior was closer to -ffreestanding than -fno-builtin, so should the variable names reflect that?



================
Comment at: llvm/include/llvm/LTO/legacy/LTOCodeGenerator.h:146
                        bool DisableInline, bool DisableGVNLoadPRE,
-                       bool DisableVectorization);
+                       bool DisableVectorization, bool DisableLTOBuiltins);
 
----------------
Why not instead add this flag as a member of LTOCodeGenerator, similar to what you do for the ThinLTOCodeGenerator?


================
Comment at: llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h:209
 
+  void setNoBuiltin(bool NoBuiltin) { DisableLTOBuiltins = NoBuiltin; }
+
----------------
document


================
Comment at: llvm/test/ThinLTO/X86/tli-nobuiltin.ll:38
+
+; Check fprintf(fp, "%s", str) -> fputs(str, fp) only when builtins are enabled
+
----------------
s/fputs/fwrite/ per earlier checks?


https://reviews.llvm.org/D30791





More information about the llvm-commits mailing list