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

1235 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 1109b42c03 Patch to check for duplicate method decls in protocols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 23:43:31 +00:00
Chris Lattner 833b2eb738 remove dead method with bogus comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42937 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 23:18:19 +00:00
Fariborz Jahanian e7f64cc250 Check and diagnose that objective-c objects may not be statically allocated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42936 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 22:10:42 +00:00
Ted Kremenek 580b664e9c Added notion of '*' specified format width/specifiers when checking
printf format strings.  Added type checking to see if the matching
width/precision argument was of type 'int'.

Thanks to Anders Carlsson for reporting this missing feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42933 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 20:51:52 +00:00
Chris Lattner 3457e8cbaa add a new SM::getDecomposedFileLoc method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 20:24:19 +00:00
Fariborz Jahanian 3fe44e4482 Fixed typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42928 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 19:53:08 +00:00
Fariborz Jahanian 4cabdfc51c Fixed a @compatible_alias bug. In the process, discovered unnecessary 2ndry lookup
ok class names and streamlined this logic to do the lookup once.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 19:38:20 +00:00
Steve Naroff 8f74476413 Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 18:49:25 +00:00
Anders Carlsson 6eda8c9cef Add some more diagnostics for va_start, fix tests so they pass with these new diags.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 17:48:41 +00:00
Fariborz Jahanian bece4ac257 Fixed a bug whereby, struct tag name matches a typedef/objc-class name
and hid them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42915 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 16:34:10 +00:00
Steve Naroff 075878af57 Temporary fix to test case. This area is currently under construction...test case will be changing again soon.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42914 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 16:15:17 +00:00
Chris Lattner cde8bc49a1 add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42887 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 00:37:26 +00:00
Ted Kremenek bef679c131 Printf argument checking now supports dynamically-passed precision
specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42886 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-12 00:11:27 +00:00
Fariborz Jahanian 243b64b000 This patch implementa objective-c's @compatibilty-alias declaration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42883 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 23:42:27 +00:00
Chris Lattner 8a12c2777c Push the rewriting APIs along. Build a trivial client that replaces tabs
with x's for now.  The APIs are all unimplemented, so it doesn't do 
anything yet! :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:38:32 +00:00
Fariborz Jahanian dfbcce2b55 Implemented parsing of objctive-c protocol conforming type used in
an identifier statement. Fixed up pretty priting to print this type 
correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 18:08:47 +00:00
Chris Lattner 88e0052dd8 add RewriterTest.cpp to xcode project.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42863 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 16:34:20 +00:00
Chris Lattner 507cc6cf97 clarify
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42862 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 16:06:02 +00:00
Chris Lattner 00bb283ecd slightly simplify interface
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 03:36:41 +00:00
Anders Carlsson b2cf3573d7 Add __builtin_va_start to the list of builtins, make __builtin_va_list available to builtin functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42857 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 01:00:40 +00:00
Fariborz Jahanian 4b6c9051c6 Patch to create protocol conforming class types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:55:41 +00:00
Chris Lattner 77cd2a0b6e add scafolding to play around with and bring up the code rewriter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:43:27 +00:00
Chris Lattner ae3758d297 update argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42854 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:38:03 +00:00
Chris Lattner ea254dbbc0 rename -parse-ast-view to -ast-view
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:37:43 +00:00
Chris Lattner 3b427b3ba5 rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11 00:18:28 +00:00
Chris Lattner 22b73ba6c6 Fix 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42849 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:42:28 +00:00
Chris Lattner a1a5178232 fix a bunch of regressions I introduced :(
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42846 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:31:03 +00:00
Steve Naroff e21b573bbf Refinements to Sema::GetObjcIdType()...
- Cache the typedef, not the type (avoids importing AST/Type.h).
- Emit an error if "id" cannot be found.
- Comment the routine and add a FIXME to reconsider how we emulate GCC's new fangled behavior. This isn't a priority for now, since almost no code depends on having "id" built-in.
- Add a test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42845 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-10 23:24:43 +00:00
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