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

957 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek 98f19b69c9 Commented out header with no section body. Will write this eventually.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42844 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:22:00 +00:00
Ted Kremenek 8bc05711e8 Added some documentation on clang CFGs. It is very rough.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42843 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:01:43 +00:00
Steve Naroff 3b950178e2 - Make sure default return/argument types (for methods) default to "id".
- Cache the "id" type in Sema...initialize ObjcIdType and TUScope (oops).
- Fix ActOnInstanceMessage to allow for "id" type receivers...still work to do (next).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42842 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 21:53:07 +00:00
Chris Lattner a31f030d5c avoid accessing off the end of identifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:59:57 +00:00
Anders Carlsson 2d85f8ba62 Emit a warning when the body of an if block is a NullStmt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42840 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:50:11 +00:00
Chris Lattner 6f688e131e clang -E should not print tokens from the predefines buffer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42838 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 20:45:16 +00:00
Hartmut Kaiser ba0f43571a Updated VC++ build system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42836 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 19:50:45 +00:00
Ted Kremenek dbff47f55c Added idea for a simple C++ checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42834 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 18:52:22 +00:00
Chris Lattner cd098477b2 add an idea
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 18:08:07 +00:00
Chris Lattner d19144b244 resolve a fixme, by moving __builtin_va_list to a more logical
place and making it correctly parameterized on the target.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42830 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 17:48:53 +00:00
Steve Naroff 640db42222 Fix a latent bug in MinimalActions (created by a recent name change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 17:45:44 +00:00
Steve Naroff e440eb8158 Remove Scope argument from ObjC actions that either don't need it or can now use TUScope.
Also improve a recently added comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42826 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 17:32:04 +00:00
Chris Lattner f1af947276 Add a dummy for the id typedef. Steve, plz fill this in. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42819 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 22:58:09 +00:00
Chris Lattner 53b0dabbe5 Make a significant change to invert the control flow handling
predefined macros.  Previously, these were handled by the driver,
now they are handled by the preprocessor.

Some fallout of this:

1. Instead of preprocessing two buffers (the predefines, then the 
   main source file)  we now start preprocessing the main source 
   file and inject the predefines as a "psuedo #include" from the
   main source file.
2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify
   Preprocessor::isInPrimaryFile.
3. The driver doesn't have to know about standard #defines, the
   preprocessor knows, which is nice for people wanting to define
   their own drivers.
4. This allows us to put normal tokens in the predefine buffer,
   for example a definition for __builtin_va_list that is 
   target-specific, and a typedef for id in objc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 22:10:18 +00:00
Steve Naroff b216c8861c Make sure methods with no return type default to "id".
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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 22:01:59 +00:00
Devang Patel 2c30d8fee8 Recognize while(1) and avoid extra blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42811 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09 20:51:27 +00:00
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