Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit f29479e

Browse files
committed
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271750 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 389b53d commit f29479e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/CodeGen/CGBlocks.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,8 +2294,9 @@ static void configureBlocksRuntimeObject(CodeGenModule &CGM,
22942294
TranslationUnitDecl *TUDecl = CGM.getContext().getTranslationUnitDecl();
22952295
DeclContext *DC = TranslationUnitDecl::castToDeclContext(TUDecl);
22962296

2297-
assert((isa<llvm::Function>(C) || isa<llvm::GlobalValue>(C)) &&
2298-
"expected Function or GlobalValue");
2297+
assert((isa<llvm::Function>(C->stripPointerCasts()) ||
2298+
isa<llvm::GlobalVariable>(C->stripPointerCasts())) &&
2299+
"expected Function or GlobalVariable");
22992300

23002301
const NamedDecl *ND = nullptr;
23012302
for (const auto &Result : DC->lookup(&II))

0 commit comments

Comments
 (0)