Граф коммитов

326 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar c4a1dea2dc More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
 - Moved Sema::getCurMethodDecl() out of line (dependent on
   ObjCMethodDecl via dyn_cast).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 05:35:13 +00:00
Daniel Dunbar e91593ef08 More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 04:54:23 +00:00
Chris Lattner b77792eabf change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54105 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 22:17:49 +00:00
Ted Kremenek b6ccaac65c Move isObjCObjectPointerType() from Sema to ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53998 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24 23:58:27 +00:00
Chris Lattner b752f28902 Switch initialization of the protocol list for an interface decl to use
the standard "set these as the list of protocols" interface instead of a 
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from 
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.

This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't.  Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on 
test/Sema/objc-interface-1.m

While I'm at it, clean up some locations so that we produce:

t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~   ^

instead of:

t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 07:06:49 +00:00
Chris Lattner b49b572aa3 improve comments yet again, now I know what this does :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:16:33 +00:00
Chris Lattner 0b6d1e6070 minor rename, also, reject pointer to qualified id.
id<NSCopyable>*  is not an "objc pointer type", id<NSCopyable> is.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:13:58 +00:00
Chris Lattner 17af2a62f3 Fix a crash that can happen when you have typedefs for pointers to
interfaces.  Just because they x->isPointerType() doesn't mean it is
valid to just cast to a pointertype.  We have to handle typedefs etc
as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:09:54 +00:00
Chris Lattner 22e684a148 simplify this predicate, only checking isObjCQualifiedIdType once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53817 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 04:03:34 +00:00
Argyrios Kyrtzidis 07952324dd Add Sema support for C++ classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 10:37:29 +00:00
Argyrios Kyrtzidis 53d0ea5f5b Replace CurFunctionDecl and CurMethodDecl with methods getCurFunctionDecl() and getCurMethodDecl() that return the appropriate Decl through CurContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52852 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 06:07:14 +00:00
Chris Lattner 27933c1761 add a fixme back
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 22:44:51 +00:00
Chris Lattner 6ee1f9c014 "This moves built-in Objective-C types up the scope chains to where they can be replaced by versions included from the runtime library's headers."
This makes it ok to use @"foo" without a declaration for NSConstantString.

Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52593 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 20:20:39 +00:00
Ted Kremenek 7ff22b259d Introduce preliminary support for NSString format-string checking.
Patch by Nikita Zhuk!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52336 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 18:00:42 +00:00
Argyrios Kyrtzidis 39ba4aeca2 -Changes to TagDecl:
Added TagKind enum.
  Added getTagKind() method.
  Added convenience methods: isEnum(), isStruct(), isUnion(), isClass().
-RecordDecl/CXXRecordDecl::Create() accept a TagKind enum instead of a DeclKind one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52160 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 23:19:58 +00:00
Steve Naroff e6fe5d46b2 Give the "isa" slot a name!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51924 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 03:03:48 +00:00
Eli Friedman 3e4177f233 Add FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 05:09:49 +00:00
Argyrios Kyrtzidis ef17782010 Addition of TranslationUnitDecl to the AST:
-Added TranslationUnitDecl class to serve as top declaration context
-ASTContext gets a TUDecl member and a getTranslationUnitDecl() function
-All ScopedDecls get the TUDecl as DeclContext when declared at global scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-17 14:40:12 +00:00
Argyrios Kyrtzidis 87f3ff0c27 Added PushOnScopeChains method to Sema, that adds a decl to both the IdResolver and the Scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-12 00:47:19 +00:00
Steve Naroff d6a07aaf62 Add class and super class location info to ObjCInterfaceDecl...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49553 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 19:35:35 +00:00
Chris Lattner 7f925cc107 Switch sema to maintaining its own scope chain information for variable
shadowing, instead of threading it through the AST.  This patch contributed
by Argiris Kirtzidis!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11 07:00:53 +00:00
Chris Lattner b048c98359 This patch contains these changes:
-Renamed ContextDecl -> DeclContext
-Removed DeclContext pointer from FieldDecl
-EnumDecl inherits from DeclContext, instead of TagDecl

Patch by Argiris Kirtzidis!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49261 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 04:47:34 +00:00
Chris Lattner 0ed844b04e Introduce ContextDecl, patch by Argiris Kirtzidis!
-Added ContextDecl (no TranslationUnitDecl)
-ScopedDecl class has a ContextDecl member
-FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily
-FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context.
-Moved Decl class to a "DeclBase.h" along with ContextDecl class
-CurContext is handled by Sema




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49208 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-04 06:12:32 +00:00
Chris Lattner 0e77ba0bf7 Add create methods for ObjCIvarDecl and ObjCInterfaceDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 01:15:50 +00:00
Chris Lattner 8e25d86818 switch the rest of the C decl classes to do their
allocation through ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 00:16:02 +00:00
Chris Lattner bda0b626e7 Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-15 23:59:48 +00:00