Manna created this revision.
Manna added a reviewer: erichkeane.
Herald added a project: All.
Manna requested review of this revision.
Herald added a project: clang.

This patch uses castAs instead of getAs which will assert if the type doesn't 
match in SetValueDataBasedOnQualType(clang::​Value &, unsigned long long).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D151770

Files:
  clang/lib/Interpreter/Interpreter.cpp


Index: clang/lib/Interpreter/Interpreter.cpp
===================================================================
--- clang/lib/Interpreter/Interpreter.cpp
+++ clang/lib/Interpreter/Interpreter.cpp
@@ -768,7 +768,7 @@
   if (const auto *ET = QT->getAs<EnumType>())
     QT = ET->getDecl()->getIntegerType();
 
-  switch (QT->getAs<BuiltinType>()->getKind()) {
+  switch (QT->castAs<BuiltinType>()->getKind()) {
   default:
     llvm_unreachable("unknown type kind!");
 #define X(type, name)                                                          
\


Index: clang/lib/Interpreter/Interpreter.cpp
===================================================================
--- clang/lib/Interpreter/Interpreter.cpp
+++ clang/lib/Interpreter/Interpreter.cpp
@@ -768,7 +768,7 @@
   if (const auto *ET = QT->getAs<EnumType>())
     QT = ET->getDecl()->getIntegerType();
 
-  switch (QT->getAs<BuiltinType>()->getKind()) {
+  switch (QT->castAs<BuiltinType>()->getKind()) {
   default:
     llvm_unreachable("unknown type kind!");
 #define X(type, name)                                                          \
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to