From 7bae9adb0850519505d9f134d1ed9b39bc2b04c9 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Fri, 3 Jun 2016 23:26:30 +0000 Subject: CodeGen: correct assertion The assertion added earlier was overly strict. We need to strip the pointer casts (as when constructing the GV). Correct the types (Function or Variable). llvm-svn: 271750 --- clang/lib/CodeGen/CGBlocks.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/CodeGen/CGBlocks.cpp') diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index 3105046cff5..5a41f361d9a 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -2294,8 +2294,9 @@ static void configureBlocksRuntimeObject(CodeGenModule &CGM, TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl(); DeclContext *DC = TranslationUnitDecl::castToDeclContext(TUDecl); - assert((isa(C) || isa(C)) && - "expected Function or GlobalValue"); + assert((isa(C->stripPointerCasts()) || + isa(C->stripPointerCasts())) && + "expected Function or GlobalVariable"); const NamedDecl *ND = nullptr; for (const auto &Result : DC->lookup(&II)) -- cgit v1.2.3