aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-11-21 19:53:08 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-11-21 19:53:08 +0000
commit13dcd00615de5c4279d97bdf63cd5f0a14fd9dcc (patch)
treeca12e37ed58b299981baa144331e1e24f9750e75 /lib/Sema/Sema.cpp
parent68c9ced7cd998ac3a26193d629e3565f01a27a7f (diff)
This patch implements objective-c's 'SEL' type as a built-in
type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89561 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index fe2d7448b4..62c2e25f52 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -299,17 +299,15 @@ void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
// Built-in ObjC types may already be set by PCHReader (hence isNull checks).
if (Context.getObjCSelType().isNull()) {
- // Synthesize "typedef struct objc_selector *SEL;"
- RecordDecl *SelTag = CreateStructDecl(Context, "objc_selector");
- PushOnScopeChains(SelTag, TUScope);
-
- QualType SelT = Context.getPointerType(Context.getTagDeclType(SelTag));
+ // Create the built-in typedef for 'SEL'.
+ QualType SelT = Context.getObjCObjectPointerType(Context.ObjCBuiltinSelTy);
DeclaratorInfo *SelInfo = Context.getTrivialDeclaratorInfo(SelT);
TypedefDecl *SelTypedef
= TypedefDecl::Create(Context, CurContext, SourceLocation(),
&Context.Idents.get("SEL"), SelInfo);
PushOnScopeChains(SelTypedef, TUScope);
Context.setObjCSelType(Context.getTypeDeclType(SelTypedef));
+ Context.ObjCSELRedefinitionType = Context.getObjCSelType();
}
// Synthesize "@class Protocol;