[cfe-commits] r96484 - in /cfe/trunk/lib: CodeGen/CGBlocks.cpp Sema/SemaDeclObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Wed Feb 17 10:11:04 PST 2010
Author: fjahanian
Date: Wed Feb 17 12:10:54 2010
New Revision: 96484
URL: http://llvm.org/viewvc/llvm-project?rev=96484&view=rev
Log:
Use proper lexcial context for newly added ivars.
Modified:
cfe/trunk/lib/CodeGen/CGBlocks.cpp
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
Modified: cfe/trunk/lib/CodeGen/CGBlocks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBlocks.cpp?rev=96484&r1=96483&r2=96484&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBlocks.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBlocks.cpp Wed Feb 17 12:10:54 2010
@@ -110,6 +110,7 @@
/// 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 @@
SelfDecl->getType(), SourceLocation(), false);
CGF->AllocateBlockDecl(BDRE);
}
+#endif
// FIXME: Also always forward the this pointer in C++ as well.
Modified: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclObjC.cpp?rev=96484&r1=96483&r2=96484&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp Wed Feb 17 12:10:54 2010
@@ -825,8 +825,8 @@
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;
More information about the cfe-commits
mailing list