mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 23:31:50 +08:00
Use proper lexcial context for newly added ivars.
llvm-svn: 96484
This commit is contained in:
@@ -110,6 +110,7 @@ static bool CanBlockBeGlobal(const CodeGenFunction::BlockInfo &Info) {
|
||||
/// invoke function.
|
||||
static void AllocateAllBlockDeclRefs(const CodeGenFunction::BlockInfo &Info,
|
||||
CodeGenFunction *CGF) {
|
||||
#if 0
|
||||
// Always allocate self, as it is often handy in the debugger, even if there
|
||||
// is no codegen in the block that uses it. This is also useful to always do
|
||||
// this as if we didn't, we'd have to figure out all code that uses a self
|
||||
@@ -122,6 +123,7 @@ static void AllocateAllBlockDeclRefs(const CodeGenFunction::BlockInfo &Info,
|
||||
SelfDecl->getType(), SourceLocation(), false);
|
||||
CGF->AllocateBlockDecl(BDRE);
|
||||
}
|
||||
#endif
|
||||
|
||||
// FIXME: Also always forward the this pointer in C++ as well.
|
||||
|
||||
|
||||
@@ -825,8 +825,8 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl,
|
||||
IDecl->setLocEnd(RBrace);
|
||||
// Add ivar's to class's DeclContext.
|
||||
for (unsigned i = 0, e = numIvars; i != e; ++i) {
|
||||
ivars[i]->setLexicalDeclContext(IDecl);
|
||||
IDecl->addDecl(ivars[i]);
|
||||
ivars[i]->setLexicalDeclContext(ImpDecl);
|
||||
IDecl->makeDeclVisibleInContext(ivars[i], false);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user