| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
filesystems (was "#include "clang/AST/DeclObjc.h", which worked fine
on a case-insensitive HFS+ volume on the Mac).
llvm-svn: 43080
|
|
|
|
| |
llvm-svn: 43075
|
|
|
|
|
|
| |
report an error if a static initializer is not constant.
llvm-svn: 43058
|
|
|
|
|
|
|
|
| |
Rename SourceRange::Begin()/End() to getBegin()/getEnd() for
consistency with other code.
Start building the rewriter towards handling @encode.
llvm-svn: 43047
|
|
|
|
|
|
| |
smaller, thanks.
llvm-svn: 43042
|
|
|
|
| |
llvm-svn: 43039
|
|
|
|
| |
llvm-svn: 43038
|
|
|
|
|
|
|
|
|
|
| |
"NSConstantString *".
This makes the typecheck much happier. Without this change, the type checker would have to special case "struct __builtin_CFString *". This change does assume the interface for NSConstantString is declared in the translation unit.
I left ASTContext::getCFConstantStringType() around for now (with a comment that says it is currently unused).
llvm-svn: 43021
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
predicates are now instance methods (they were previously static class methods on Type).
This allowed me to fix the following hack from this weekend...
// FIXME: Devise a way to do this without using strcmp.
// Would like to say..."return getAsStructureType() == IdStructType;", but
// we don't have a pointer to ASTContext.
bool Type::isObjcIdType() const {
if (const RecordType *RT = getAsStructureType())
return !strcmp(RT->getDecl()->getName(), "objc_object");
return false;
}
...which is now...
bool isObjcIdType(QualType T) const {
return T->getAsStructureType() == IdStructType;
}
Side notes:
- I had to remove a convenience function from the TypesCompatibleExpr class.
int typesAreCompatible() const {return Type::typesAreCompatible(Type1,Type2);}
Which required a couple clients get a little more verbose...
- Result = TCE->typesAreCompatible();
+ Result = Ctx.typesAreCompatible(TCE->getArgType1(), TCE->getArgType2());
Overall, I think this change also makes sense for a couple reasons...
1) Since ASTContext vends types, it makes sense for the type compatibility API to be there.
2) This allows the type compatibility predeciates to refer to data not strictly present in the AST (which I have found problematic on several occasions).
llvm-svn: 43009
|
|
|
|
| |
llvm-svn: 43006
|
|
|
|
|
|
| |
Also noticed ASTContext::BuiltinVaListType wasn't being initialized to the null type (so I set it).
llvm-svn: 42983
|
|
|
|
|
|
|
|
|
| |
[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang t.m
t.m:29:18: warning: incompatible pointer types assigning 'id' to 'NSString *'
resultString = [[NSString alloc] initWithFormat:0 arguments:0];
~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-svn: 42975
|
|
|
|
| |
llvm-svn: 42974
|
|
|
|
|
|
|
| |
- Start looking up methods in the global method pools (for "id").
- Start integrating interface types into the type system.
llvm-svn: 42971
|
|
|
|
|
|
| |
Changed ObjcInterfaceDecl::ListCategories->CategoryList.
llvm-svn: 42968
|
|
|
|
| |
llvm-svn: 42939
|
|
|
|
| |
llvm-svn: 42883
|
|
|
|
|
|
|
| |
an identifier statement. Fixed up pretty priting to print this type
correctly.
llvm-svn: 42866
|
|
|
|
| |
llvm-svn: 42858
|
|
|
|
|
|
| |
available to builtin functions.
llvm-svn: 42857
|
|
|
|
| |
llvm-svn: 42856
|
|
|
|
| |
llvm-svn: 42849
|
|
|
|
|
|
|
|
|
|
| |
This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added).
Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope.
Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped).
llvm-svn: 42817
|
|
|
|
|
|
|
|
|
| |
likewise block and param. Reorder the layout of the Decl kind enum
so that the inheritance tree is reflected in the ordering. This allows
trivial range comparisons to determine whether something is an instance
of some abstract class, making classof faster.
llvm-svn: 42772
|
|
|
|
| |
llvm-svn: 42731
|
|
|
|
| |
llvm-svn: 42730
|
|
|
|
|
|
|
|
|
|
| |
NamedDecl is a Decl that has an IdentifierInfo (for example, ScopedDecl),
but not ObjcMethodDecl.
Simplify some code in ActOnAddMethodsToObjcDecl, by doing the cast from
DeclTy to Decl at the start of the method.
llvm-svn: 42710
|
|
|
|
| |
llvm-svn: 42608
|
|
|
|
| |
llvm-svn: 42601
|
|
|
|
|
|
| |
and their accessors in a variety of objective-c classes.
llvm-svn: 42555
|
|
|
|
|
|
|
|
| |
- Add ObjcMessageExpr::getSelector(), getClassName().
- Change Sema::getObjCInterfaceDecl() to simply take an IdentifierInfo (no Scope needed).
- Remove FIXME for printing ObjCMessageExpr's.
llvm-svn: 42543
|
|
|
|
|
|
|
|
| |
related to
unimplemented methods in category implementation.
llvm-svn: 42531
|
|
|
|
|
|
| |
tracked BlkExpr information now maintained by the CFG class.
llvm-svn: 42498
|
|
|
|
|
|
|
|
| |
expressions to IDs. This is used by various dataflow analyses, but is
also useful for anyone querying a CFG to determine where an expression
is evaluated.
llvm-svn: 42495
|
|
|
|
|
|
| |
Update clients and add to project file.
llvm-svn: 42494
|
|
|
|
|
|
|
| |
September 30, 2007 12:36:58 AM PDT and
September 30, 2007 12:50:05 AM PDT
llvm-svn: 42490
|
|
|
|
|
|
|
|
| |
as a member function. This function is no longer needed within the CFG
class, and logically belongs to the Stmt class as a predicate for a
Stmt instance.
llvm-svn: 42489
|
|
|
|
| |
llvm-svn: 42485
|
|
|
|
|
|
|
|
|
|
|
|
| |
This motivated implementing a devious clattner inspired solution:-)
This approach uses a small value "Selector" class to point to an IdentifierInfo for the 0/1 case. For multi-keyword selectors, we instantiate a MultiKeywordSelector object (previously known as SelectorInfo). Now, the incremental cost for selectors is only 24,800 for Cocoa.h! This saves 156,592 bytes, or 86%!! The size reduction is also the result of getting rid of the AST slot, which was not strictly necessary (we will associate a selector with it's method using another table...most likely in Sema).
This change was critical to make now, before we have too many clients.
I still need to add some comments to the Selector class...will likely add later today/tomorrow.
llvm-svn: 42452
|
|
|
|
|
|
|
|
| |
with method implementation declarations .
It checks and warns on those methods declared in class interface and not implemented.
llvm-svn: 42412
|
|
|
|
| |
llvm-svn: 42396
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is SelectorInfo is not string-oriented, it is a unique aggregate of IdentifierInfo's (using a folding set). SelectorInfo also has a richer API that simplifies the parser/action interface. 3 noteworthy benefits:
#1: It is cleaner. I never "liked" storing keyword selectors (i.e. foo:bar:baz) in the IdentifierTable.
#2: It is more space efficient. Since Cocoa keyword selectors can be quite long, this technique is space saving. For Cocoa.h, pulling the keyword selectors out saves ~180k. The cost of the SelectorInfo data is ~100k. Saves ~80k, or 43%.
#3: It results in many API simplifications. Here are some highlights:
- Removed 3 actions (ActOnKeywordMessage, ActOnUnaryMessage, & one flavor of ObjcBuildMethodDeclaration that was specific to unary messages).
- Removed 3 funky structs from DeclSpec.h (ObjcKeywordMessage, ObjcKeywordDecl, and ObjcKeywordInfo).
- Removed 2 ivars and 2 constructors from ObjCMessageExpr (fyi, this space savings has not been measured).
I am happy with the way it turned out (though it took a bit more hacking than I expected). Given the central role of selectors in ObjC, making sure this is "right" will pay dividends later.
Thanks to Chris for talking this through with me and suggesting this approach.
llvm-svn: 42395
|
|
|
|
|
|
|
|
|
|
| |
fixing:
VoidMethod.m:14:5: warning: expression result unused
[Greeter hello];
^~~~~~~~~~~~~~~
llvm-svn: 42380
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG 1)
CFG failed to build for empty functions, or functions containing only
NullStmts or empty compound statements.
We now handle such cases, although now we cannot test for CFG
construction failure by asserting that the last block constructed is
not NULL (since it now may be).
BUG 2)
CFG construction segfaulted on some cases when walking the AST and not
taking into account that some children of a statement may be NULL.
llvm-svn: 42370
|
|
|
|
|
|
|
| |
that they conform(in type, name and numbers) to those declared in @interface.
Test case highlights kind of checking we do here.
llvm-svn: 42360
|
|
|
|
| |
llvm-svn: 42334
|
|
|
|
|
|
|
|
|
| |
info. It also adds more
semantic checks for class and protocol declarations. Test cases are good indications of kind of
checking being done in this patch.
llvm-svn: 42311
|
|
|
|
| |
llvm-svn: 42291
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
integer constant expressions. The only questionable
thing is that we now reject:
void foo() {
switch (1) {
case (int)1.0e10000:
;
}
}
with:
t.c:5:13: error: case label does not reduce to an integer constant
case (int)1.0e10000:
~~~~~^~~~~~~~~
GCC accepts this, emitting the pedwarn:
t.c:5: warning: floating constant exceeds range of 'double'
llvm-svn: 42238
|
|
|
|
|
|
| |
APFloat straight through to LLVM now.
llvm-svn: 42236
|