diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-06-03 23:26:30 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-06-03 23:26:30 +0000 |
commit | 7bae9adb0850519505d9f134d1ed9b39bc2b04c9 (patch) | |
tree | 48740ec662a39af2e7f96f237c464f1fd1af9462 /clang/lib/CodeGen/CGBlocks.cpp | |
parent | c0d89826a71aef103c0cddc7d99cb560457e3a9f (diff) | |
download | bcm5719-llvm-7bae9adb0850519505d9f134d1ed9b39bc2b04c9.tar.gz bcm5719-llvm-7bae9adb0850519505d9f134d1ed9b39bc2b04c9.zip |
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
Diffstat (limited to 'clang/lib/CodeGen/CGBlocks.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGBlocks.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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<llvm::Function>(C) || isa<llvm::GlobalValue>(C)) && - "expected Function or GlobalValue"); + assert((isa<llvm::Function>(C->stripPointerCasts()) || + isa<llvm::GlobalVariable>(C->stripPointerCasts())) && + "expected Function or GlobalVariable"); const NamedDecl *ND = nullptr; for (const auto &Result : DC->lookup(&II)) |