зеркало из https://github.com/microsoft/clang.git
Fixup generated code for imported block decl refs.
Found while investigating <rdar://problem/6435837> clang ObjC rewriter: use Block_release instead of Block_destroy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60898 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
e267ff35b2
Коммит
47a2422088
|
@ -3516,9 +3516,9 @@ std::string RewriteObjC::SynthesizeBlockHelperFuncs(BlockExpr *CE, int i,
|
|||
S += "*src) {";
|
||||
for (llvm::SmallPtrSet<ValueDecl*,8>::iterator I = ImportedBlockDecls.begin(),
|
||||
E = ImportedBlockDecls.end(); I != E; ++I) {
|
||||
S += "_Block_copy_assign(&dst->";
|
||||
S += "_Block_copy_assign((void*)&dst->";
|
||||
S += (*I)->getNameAsString();
|
||||
S += ", src->";
|
||||
S += ", (void*)src->";
|
||||
S += (*I)->getNameAsString();
|
||||
S += ");}";
|
||||
}
|
||||
|
@ -3529,7 +3529,7 @@ std::string RewriteObjC::SynthesizeBlockHelperFuncs(BlockExpr *CE, int i,
|
|||
S += "*src) {";
|
||||
for (llvm::SmallPtrSet<ValueDecl*,8>::iterator I = ImportedBlockDecls.begin(),
|
||||
E = ImportedBlockDecls.end(); I != E; ++I) {
|
||||
S += "_Block_destroy(src->";
|
||||
S += "_Block_destroy((void*)src->";
|
||||
S += (*I)->getNameAsString();
|
||||
S += ");";
|
||||
}
|
||||
|
@ -3993,7 +3993,7 @@ void RewriteObjC::CollectBlockDeclRefInfo(BlockExpr *Exp) {
|
|||
}
|
||||
// Find any imported blocks...they will need special attention.
|
||||
for (unsigned i = 0; i < BlockDeclRefs.size(); i++)
|
||||
if (isBlockPointerType(BlockDeclRefs[i]->getType())) {
|
||||
if (BlockDeclRefs[i]->getType()->isBlockPointerType()) {
|
||||
GetBlockCallExprs(BlockDeclRefs[i]);
|
||||
ImportedBlockDecls.insert(BlockDeclRefs[i]->getDecl());
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче