[clang] 37bc1dc - [NFC] Workaround MSVC2019 32-bit compiler crash
Sven van Haastregt via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 27 03:16:10 PDT 2021
Author: Sven van Haastregt
Date: 2021-04-27T11:15:47+01:00
New Revision: 37bc1dc9877fc480493c85c6d02709b3015bb5e8
URL: https://github.com/llvm/llvm-project/commit/37bc1dc9877fc480493c85c6d02709b3015bb5e8
DIFF: https://github.com/llvm/llvm-project/commit/37bc1dc9877fc480493c85c6d02709b3015bb5e8.diff
LOG: [NFC] Workaround MSVC2019 32-bit compiler crash
As reported on D100492, this restructuring should stop the internal
compiler error from happening.
Fixes PR50128.
Added:
Modified:
clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
Removed:
################################################################################
diff --git a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
index 1e274389b119b..91227797a757f 100644
--- a/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
+++ b/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
@@ -525,17 +525,18 @@ void BuiltinNameEmitter::EmitBuiltinTable() {
for (const auto &Overload : SLM.second.Signatures) {
StringRef ExtName = Overload.first->getValueAsDef("Extension")->getName();
+ unsigned int MinVersion =
+ Overload.first->getValueAsDef("MinVersion")->getValueAsInt("ID");
+ unsigned int MaxVersion =
+ Overload.first->getValueAsDef("MaxVersion")->getValueAsInt("ID");
+
OS << " { " << Overload.second << ", "
<< Overload.first->getValueAsListOfDefs("Signature").size() << ", "
<< (Overload.first->getValueAsBit("IsPure")) << ", "
<< (Overload.first->getValueAsBit("IsConst")) << ", "
<< (Overload.first->getValueAsBit("IsConv")) << ", "
<< FunctionExtensionIndex[ExtName] << ", "
- << EncodeVersions(Overload.first->getValueAsDef("MinVersion")
- ->getValueAsInt("ID"),
- Overload.first->getValueAsDef("MaxVersion")
- ->getValueAsInt("ID"))
- << " },\n";
+ << EncodeVersions(MinVersion, MaxVersion) << " },\n";
Index++;
}
}
More information about the cfe-commits
mailing list