summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2018-04-11 18:17:35 +0000
committerShoaib Meenai <smeenai@fb.com>2018-04-11 18:17:35 +0000
commit34aa13169b5aed623c227191bb36fa118d766ba1 (patch)
tree9bede0c60bdd05f74664f1abe32092638434099c /clang/lib/CodeGen
parentb24953bbfbc99b21d01ffaf673e11a44b4951b90 (diff)
downloadbcm5719-llvm-34aa13169b5aed623c227191bb36fa118d766ba1.tar.gz
bcm5719-llvm-34aa13169b5aed623c227191bb36fa118d766ba1.zip
[CodeGen] Handle __func__ inside __finally
When we enter a __finally block, the CGF's CurCodeDecl will be null (because CodeGenFunction::StartFunction is given an empty GlobalDecl for a __finally block), and so the dyn_cast here will result in an assertion failure. Change it to dyn_cast_or_null to handle this case. Differential Revision: https://reviews.llvm.org/D45523 llvm-svn: 329836
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index ba34208230f..55b67db6d0e 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -2611,7 +2611,7 @@ LValue CodeGenFunction::EmitPredefinedLValue(const PredefinedExpr *E) {
StringRef NameItems[] = {
PredefinedExpr::getIdentTypeName(E->getIdentType()), FnName};
std::string GVName = llvm::join(NameItems, NameItems + 2, ".");
- if (auto *BD = dyn_cast<BlockDecl>(CurCodeDecl)) {
+ if (auto *BD = dyn_cast_or_null<BlockDecl>(CurCodeDecl)) {
std::string Name = SL->getString();
if (!Name.empty()) {
unsigned Discriminator =
OpenPOWER on IntegriCloud