The changes adds support for -fno-builtin-foo options.
This addresses PR4941 and rdar://6756912.
Please take a look.
Chad
Paths
| Differential D15195
PR4941: Add support for -fno-builtin-foo options. ClosedPublic Authored by mcrosier on Dec 3 2015, 10:12 AM.
Details
Summary The changes adds support for -fno-builtin-foo options. This addresses PR4941 and rdar://6756912. Please take a look. Chad
Diff Detail Event Timelinemcrosier updated this object. Comment Actions Can you use a StringSet instead of a vector and avoid all (most) of the code iterating over the vector of builtins being disabled?
Comment Actions
Hi Hal, Chad Chad Comment Actions
In that case, let's stick with the vector for now. We can always improve things later if we'd like. Comment Actions Regarding the FIXME in lib/Frontend/CompilerInvocation.cpp: I agree with Hal that you can remove that. We used to complain about unsupported -fno-builtin-* options (and until now they have *all* been unsupported), but in r191434, Rafael changed clang to silently ignore those options, with the explanation that it matches gcc's behavior. Assuming that gcc has not changed in that regard, it makes sense that we should continue to ignore -fno-builtin-* for unsupported options. mcrosier edited edge metadata. Comment ActionsRemove the FIXME, per Hal and Bob's request. I confirmed that gcc does not warn for invalid -fno-builtin-foo options. This revision is now accepted and ready to land.Jan 5 2016, 9:03 AM
Revision Contents
Diff 42854 include/clang/Basic/Builtins.h
include/clang/Basic/LangOptions.h
include/clang/Driver/Options.td
include/clang/Frontend/CodeGenOptions.h
lib/Basic/Builtins.cpp
lib/Basic/LangOptions.cpp
lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CGCall.cpp
lib/CodeGen/CGVTables.cpp
lib/CodeGen/CodeGenModule.h
lib/CodeGen/CodeGenModule.cpp
lib/Driver/Tools.cpp
lib/Frontend/CodeGenOptions.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/2007-04-14-FNoBuiltin.c
test/CodeGen/libcalls-complex.c
test/CodeGen/libcalls-fno-builtin.c
test/CodeGen/nobuiltin.c
test/Sema/implicit-builtin-freestanding.c
|
I'd remove this; there's no need for Clang to know about all functions that the optimizer knows about, and thus for which adding the nobuiltin attribute might be useful.