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

1041 Коммитов

Автор SHA1 Сообщение Дата
Devang Patel a2c534223d new test
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42810 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 20:37:41 +00:00
Chris Lattner 90ae68aae9 avoid a noop virtual method call on the hot scope poping path.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42809 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 20:37:18 +00:00
Devang Patel 05f6e6bb3a Recognize "do {} while (0)" idiom and avoid extra basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42808 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 20:33:39 +00:00
Devang Patel 50c9034ea9 Use LLVMFoldingBuilder
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 19:49:58 +00:00
Fariborz Jahanian 0be657cb85 Remove comment about protocols and namespace no longer relevant.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42804 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:28:41 +00:00
Fariborz Jahanian 8fe5c2a902 Minor code clean up to make it more readable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:22:59 +00:00
Chris Lattner 4de884d3fb Update DeclKind enums to reflect ObjcProtocolDecl's inheritance change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:18:24 +00:00
Fariborz Jahanian 05672a0ce8 Remove addition of protocol names to declaration scopes, use a separate
DenseMap to keep track of such declarations and derive ObjcProtocolDecl
directyly from NamedScope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42801 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:03:53 +00:00
Chris Lattner 057aaf6304 convert driver over to use Token::is/isNot APIs. fwew, all done.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42800 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:03:42 +00:00
Chris Lattner 22f6bbcafa Switch lexer/pp over to new Token::is/isNot api
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42799 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 18:02:16 +00:00
Chris Lattner df19526177 swtich to Token::is/isNot
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42798 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:51:17 +00:00
Chris Lattner 4e1d99a8a4 switch more code to use Token::is/isNot where possible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42797 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:41:39 +00:00
Chris Lattner 04d6666eee switch some more of the parser over to using Token::is and isNot
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:33:22 +00:00
Chris Lattner 0007322266 Add two new Token helper functions, "is" and "isNot". This allows us to write
stuff like this:

       // If we don't have a comma, it is either the end of the list (a ';') or
       // an error, bail out.
       if (Tok.isNot(tok::comma))
         break;
instead of:
       // If we don't have a comma, it is either the end of the list (a ';') or
       // an error, bail out.
       if (Tok.getKind() != tok::comma)
         break;

There is obviously no functionality change, but the code reads a bit better and is 
more terse.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:23:58 +00:00
Fariborz Jahanian 878520b641 Added better comment about protocol list for class ObjcQualifiedInterfaceType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:14:13 +00:00
Chris Lattner b652cea7d7 rename some "Parse" actions to "ActOn". Move code around in
ParseFunctionDefinition so that ActOnFunctionDefBody is always
called if ActOnStartOfFunctionDef is called.  This fixes a crash
reported by Nuno Lopes.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:14:05 +00:00
Devang Patel 00ee4e4ddc Use const& for RHS.
Use copy for LHS, because it is incremented using ++ operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42792 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:10:59 +00:00
Devang Patel 80fd5f96e6 Fix comment. Describe what it is, instead of how it is used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:08:50 +00:00
Fariborz Jahanian 22d71d6805 Prevent memory leak by not creating a category object when there is a
fatal error of category's undefined interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42790 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 17:05:22 +00:00
Steve Naroff 71e99080e7 Remove 2 protocol related actions from MinimalActions (protocols shouldn't be recognized as types).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42777 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 23:10:47 +00:00
Fariborz Jahanian e37882ad33 Added a new class for Interfaces qualified by protocol list.
Protocols are now sorted and made unique in the list.
Enhanced pretty printer for @interface (So, I can see the protocol list).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 23:06:41 +00:00
Steve Naroff 22cdd239dc Removed unused instance variable from FieldDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42773 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:56:47 +00:00
Chris Lattner aa9fc46c6a Rename FileVariable -> FileVar for consistency with its class name,
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42772 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:37:32 +00:00
Chris Lattner 2d29581d2b add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42771 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:36:22 +00:00
Chris Lattner 8307adb684 Move identifierTable.h to the right folder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42770 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:35:59 +00:00
Steve Naroff eefc418b8e Convert Selector Maps/Sets to use stronger typing (now that we have DenseMapInfo in IdentifierTable.h).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42767 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 21:05:34 +00:00
Devang Patel c049e4f406 Code gen case statement ranges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42766 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 20:57:48 +00:00
Fariborz Jahanian ab0aeb0bf3 Several small patches to do pretty printing for objective-c top-level decls
(minimal printing), Derive ObjcClassDecl from Decl. Ted may want to 
take note of the change I made to CFGRecStmtDeclVisitor.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42764 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 18:53:38 +00:00
Fariborz Jahanian 6d4caf2694 Removed unnecessary base class from some of objective-c classes:
ObjcProtocolDecl is now derived from ScopedDecl. ObjcForwardProtocolDecl from Decl.
ObjcImplementationDecl fom NamedDecl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 17:35:11 +00:00
Fariborz Jahanian 0332b6c838 Return NULL on invalid protocol.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42754 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-08 16:07:03 +00:00
Chris Lattner 13afd24bed remove unneeded #include
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42731 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:59:27 +00:00
Chris Lattner c7229c338c move IdentifierTable.h from liblex to libbasic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:58:51 +00:00
Chris Lattner dbf388b54b implement the Token class in the Lexer.cpp file instead of IdentifierInfo.cpp
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42728 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:47:24 +00:00
Chris Lattner cc1a875f94 improve layering:
Now instead of IdentifierInfo knowing anything about MacroInfo,
only the preprocessor knows.  This makes MacroInfo truly private
to the Lex library (and its direct clients) instead of being 
accessed in the Basic library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42727 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:44:20 +00:00
Chris Lattner 0edde55077 change calls to getMacroInfo into hasMacroDefinition() where possible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 08:04:56 +00:00
Chris Lattner 9c46de446d add a hasMacroDefinition() method to IdentifierInfo, strength reduce a
call to getMacroInfo to call it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42725 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 07:57:27 +00:00
Chris Lattner 6d9a3e648d update comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42724 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 07:54:23 +00:00
Chris Lattner 387b98d37e Remove the PPID bitfield from IdentifierInfo, shrinking it by a word
(because all bitfields now fit in 32 bits).  This shrinks the identifier
table for carbon.h from 1634428 to 1451424 bytes (12%) and has no impact 
on compile time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42723 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 07:52:34 +00:00
Chris Lattner 4365a7e468 First step to fixing a long lived layering violation: this
moves the MacroInfo pointer to a side hash table (which currently 
lives in IdentifierTable.cpp).  This removes a pointer from 
Identifier info, but doesn't shrink it, as it requires a new bit 
be added.  This strange approach with the 'hasmacro' bit is needed
to not lose preprocessor performance.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42722 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 07:09:52 +00:00
Chris Lattner 60c52187e0 The identifier shouldn't be added to the scope, the decl should.
This fixes strange assertions that just started triggering.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42721 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 07:05:08 +00:00
Chris Lattner f47a7f8531 classof isn't right. This is causing assertion failures somehow now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42720 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 07:04:41 +00:00
Chris Lattner adb83b41cb Shrink the builtinID down by 3 bits, allowing all the bitfields to
fit in 32-bits, shrinking IdentifierInfo by a word.

This shrinks the total size of the identifier pool from 
1817264 to 1634428 bytes (11%) on carbon.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42719 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 06:29:32 +00:00
Chris Lattner 97e8b6f3c5 Rename ASTStreamers.* -> ASTConsumers.*
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 06:04:32 +00:00
Chris Lattner ff38491c18 simplify the interfaces to create selectors: getSelector can take any
number of arguments now and does the right thing, but the nullary/unary
accessors are preserved as convenience functions.  This allows us to
slightly simplify clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42716 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 02:00:24 +00:00
Chris Lattner f836e3fea2 simplify some Selector interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 01:33:16 +00:00
Chris Lattner f387668708 move ImplementationClassInfo out of ASTContext into Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42714 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07 01:13:46 +00:00
Chris Lattner 675218bd93 add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 23:30:21 +00:00
Chris Lattner 6a0e89eece switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 23:12:31 +00:00
Chris Lattner fd5de47147 introduce a new NamedDecl class, switch a couple of things over to using it.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42710 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 22:53:46 +00:00
Chris Lattner e5ab7f3105 Every decl has a SourceLocation, move the location info into the Decl class instead of being in subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06 22:16:01 +00:00