diff options
author | Reid Kleckner <rnk@google.com> | 2020-11-24 14:48:05 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2020-11-25 11:55:01 -0800 |
commit | 3bd06727267184223464f11d4e2470048ac40cb1 (patch) | |
tree | df92fc8258dc7dc0143776182abf09e7701d5137 /clang/lib/CodeGen/CodeGenFunction.h | |
parent | a0156356296b54dc071405332a517695b1881bc1 (diff) | |
download | llvm-3bd06727267184223464f11d4e2470048ac40cb1.zip llvm-3bd06727267184223464f11d4e2470048ac40cb1.tar.gz llvm-3bd06727267184223464f11d4e2470048ac40cb1.tar.bz2 |
[MS] Fix double evaluation of MSVC builtin arguments
This code got quite twisted because we consider some MSVC builtins to be
target agnostic, and some to be target specific. Target specific
intrinsics have a pattern of doing up-front argument evaluation, while
general intrinsics do not evaluate their arguments up front. As we tried
to share codepaths between the target-specific and target-agnostic
handling, we ended up doing double evaluation.
Instead, have each target handle MSVC intrinsics consistently before up
front argument evaluation. This requires passing less data around and is
more consistent with target independent intrinsic handling.
See D50979 for past examples of this bug. I noticed this while looking
into adding some more intrinsics.
Differential Revision: https://reviews.llvm.org/D92061
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 40efa6d..95e7d77 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -4120,10 +4120,7 @@ public: llvm::AtomicOrdering &AO, llvm::SyncScope::ID &SSID); -private: enum class MSVCIntrin; - -public: llvm::Value *EmitMSVCBuiltinExpr(MSVCIntrin BuiltinID, const CallExpr *E); llvm::Value *EmitBuiltinAvailable(const VersionTuple &Version); |