summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-02-17 18:10:54 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-02-17 18:10:54 +0000
commitc0309cd3d1f645f235245085827f33adecf1ff50 (patch)
tree98fe7bd8cfcbfe8dba77196acf6e844f606a566f /clang/lib
parenta11c45866eba33eda0f4c74c952273b24f23d270 (diff)
downloadbcm5719-llvm-c0309cd3d1f645f235245085827f33adecf1ff50.tar.gz
bcm5719-llvm-c0309cd3d1f645f235245085827f33adecf1ff50.zip
Use proper lexcial context for newly added ivars.
llvm-svn: 96484
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBlocks.cpp2
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 46b62441d6e..26374af03a9 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -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.
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 465c4a9ee18..a7e0145a521 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -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;
OpenPOWER on IntegriCloud