We need x86-64-specific builtins if we want to implement some of the MS intrinsics - winnt.h contains definitions of some functions for i386, but not for x86-64 (for example _InterlockedOr64), which means that we cannot treat them as builtins for both i386 and x86-64, because then we have definitions of builtin functions in winnt.h on i386.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/Basic/BuiltinsX86_32.def | ||
---|---|---|
1 ↗ | (On Diff #71470) | Will we ever need that file? It seems to nicely complement the 64-bit one, but if it's going to be empty forever maybe it's better to remove it. |
lib/Basic/Targets.cpp | ||
---|---|---|
2319 ↗ | (On Diff #71470) | I'd rather not duplicate this readonly data. I had this clever idea that we'd do something like: const Builtin::Info BuiltinInfo[] = { ... #include "BuiltinsX86_32.def" #include "BuiltinsX86.def" #include "BuiltinsX86_64.def" }; And then our makeArrayRef call would take the appropriate parts. |
include/clang/Basic/BuiltinsX86_32.def | ||
---|---|---|
1 ↗ | (On Diff #71470) | I guess we should remove it. Take a look at isX86_64Builtin in Sema/SemaChecking.cpp. It might be good to, as a follow-up change, move those builtins over to BuiltinsX86_64.def. |
Let's avoid the duplicate enum, otherwise looks good
include/clang/Basic/TargetBuiltins.h | ||
---|---|---|
100 ↗ | (On Diff #73375) | I think this would be better with just one enum to reduce compilation time: /// \brief X86 builtins namespace X86 { enum { LastTIBuiltin = clang::Builtin::FirstTSBuiltin - 1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, #include "clang/Basic/BuiltinsX86.def" FirstX86_64Builtin, LastX86CommonBuiltin = FirstX86_64Builtin - 1, #define BUILTIN(ID, TYPE, ATTRS) BI##ID, #include "clang/Basic/BuiltinsX86_64.def" LastTSBuiltin }; } |
include/clang/Basic/TargetBuiltins.h | ||
---|---|---|
100 ↗ | (On Diff #73375) | Nice, thanks! |
include/clang/Basic/TargetBuiltins.h | ||
---|---|---|
100 ↗ | (On Diff #73375) | Ah, now I see that LastTIBuiltin is also what its name suggests, so it's only LastTSBuiltin that's different. |