summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Change CheckIncrementDecrementOperand to test for common cases firstChris Lattner2008-11-211-21/+24
| | | | | | and fall through better. llvm-svn: 59799
* Cleanup memory management in overloading of operator->, slightlyDouglas Gregor2008-11-211-8/+9
| | | | llvm-svn: 59791
* Don't print canonical types in overloading-related diagnosticsDouglas Gregor2008-11-212-7/+27
| | | | llvm-svn: 59789
* PTHLexer:Ted Kremenek2008-11-211-14/+26
| | | | | | - Move out logic for handling the end-of-file to LexEndOfFile (to match the Lexer) class. The logic now mirrors the Lexer class more, which allows us to pass most of the Preprocessor test cases. llvm-svn: 59768
* Consolidated @try and @synchronize into a singleFariborz Jahanian2008-11-214-119/+45
| | | | | | code gen. method. llvm-svn: 59767
* - Clean up transfer function logic for 'return' statements.Ted Kremenek2008-11-212-38/+38
| | | | | | - Add check for returning an undefined value to a caller. llvm-svn: 59764
* Support generation of objc_assign_ivar for ivarFariborz Jahanian2008-11-202-3/+19
| | | | | | write-barriers. llvm-svn: 59748
* PTHLexer:Ted Kremenek2008-11-201-0/+12
| | | | | | | - Move PTHLexer::GetToken() to be inside PTHLexer.cpp. - When lexing in raw mode, null out identifiers. llvm-svn: 59744
* __weak ivar need not warn.Fariborz Jahanian2008-11-201-1/+1
| | | | llvm-svn: 59743
* Introducing objc_assign_ivar to clang.Fariborz Jahanian2008-11-203-0/+33
| | | | llvm-svn: 59740
* Added a test case for __weak field decls. Change SetVarDeclObjCAttributeFariborz Jahanian2008-11-202-10/+9
| | | | | | to static function. Added comments. llvm-svn: 59738
* Handle another case where we should use PTHLexer as an alternative to the ↵Ted Kremenek2008-11-201-1/+3
| | | | | | normal Lexer. llvm-svn: 59736
* PTHLexer:Ted Kremenek2008-11-201-19/+11
| | | | | | | | | | - Rename 'CurToken' and 'LastToken' to 'CurTokenIdx' and 'LastTokenIdx' respectively. - Add helper methods GetToken(), AdvanceToken(), AtLastToken() to abstract away details of the token stream. This also allows us to easily replace their implementation later. llvm-svn: 59733
* Add support for overloaded operator-> when used in a member accessDouglas Gregor2008-11-203-0/+86
| | | | | | expression (smart_ptr->mem). llvm-svn: 59732
* Rename IsNonPragmaNonMacroLexer to IsFileLexer.Ted Kremenek2008-11-202-7/+7
| | | | llvm-svn: 59731
* Fix strange quote charactersDouglas Gregor2008-11-201-4/+4
| | | | llvm-svn: 59729
* Rewrote PTHLexer::Lex by digging through the sources of Lexer again. Now we ↵Ted Kremenek2008-11-201-28/+37
| | | | | | can do basic macro expansion using the PTHLexer. llvm-svn: 59724
* Add ugly "test harness" for PTHLexer that is not enabled by default. TheTed Kremenek2008-11-201-6/+49
| | | | | | | | | | (temporary hack) to test the PTHLexer is that whenever we would create a Lexer object we instead raw lex a memory buffer first and then use the PTHLexer. This logic exists only to driver the PTHLexer and will be removed/changed in the future. Note that the regular path using normal Lexer objects is what is used by default. llvm-svn: 59723
* Daniel really really likes = instead of += :)Chris Lattner2008-11-202-2/+2
| | | | llvm-svn: 59716
* remove the last old-fashioned Diag method. Transition complete!Chris Lattner2008-11-209-89/+79
| | | | llvm-svn: 59714
* remove another old Diag method.Chris Lattner2008-11-205-52/+43
| | | | llvm-svn: 59713
* remove another old-school Diag method.Chris Lattner2008-11-2011-125/+109
| | | | llvm-svn: 59712
* remove the type_info identifier cache. Compared to the costChris Lattner2008-11-203-17/+7
| | | | | | | | | | | of doing the lookup_decl, the hash lookup is cheap. Also, typeid doesn't happen enough in real world code to worry about it. I'd like to eventually get rid of KnownFunctionIDs from Sema also, but today is not that day. llvm-svn: 59711
* compared to the rest of the code in Sema::GetStdNamespace(),Chris Lattner2008-11-203-3/+2
| | | | | | | looking up the "std" identifier is trivial. Just do it, particularly since this is only done if the namespace hasn't already been looked up. llvm-svn: 59710
* remove some other identifiers that are looked up really early and onlyChris Lattner2008-11-203-15/+15
| | | | | | used in one cold place. llvm-svn: 59709
* instead of looking up super at startup time, Chris Lattner2008-11-204-7/+2
| | | | | | | just check for it when needed. It doesn't incur real cost in any hot paths. llvm-svn: 59708
* Rename IdentifierInfo::isName to ::isStr. Use a nifty trickChris Lattner2008-11-204-15/+15
| | | | | | | from Sebastian to enforce that a literal string is passed in, and use this to avoid having to call strlen on it. llvm-svn: 59706
* Make FIXME a hard assertion.Ted Kremenek2008-11-201-2/+6
| | | | llvm-svn: 59695
* Preprocessor::getCurrentFileLexer() now returns a PreprocessorLexer* instead ofTed Kremenek2008-11-201-5/+6
| | | | | | | a Lexer*. This means it will either return the current (normal) file Lexer or a PTHLexer. llvm-svn: 59694
* Just use the SourceLocation of SysHeaderTok when doing a callback to emit #lineTed Kremenek2008-11-201-2/+2
| | | | | | | information. A diff of the -E output for Cocoa.h shows that there is no change in output. llvm-svn: 59693
* Assign the result of getCurrentFileLexer() to a PreprocessorLexer* instead ↵Ted Kremenek2008-11-201-1/+1
| | | | | | of Lexer* (narrower interface). llvm-svn: 59691
* - Default initialize ParsingPreprocessorDirective, ParsingFilename, andTed Kremenek2008-11-202-16/+16
| | | | | | | | LexingRawMode in the ctor of PreprocessorLexer. - PTHLexer: Use "LastToken" instead of "NumToken" llvm-svn: 59690
* Add (untested) implementation of PTHLexer::isNextPPTokenLParen() and ↵Ted Kremenek2008-11-201-4/+14
| | | | | | PTHLexer::DiscardToEndOfLine(). llvm-svn: 59687
* More objc gc stuff. Read/Write barriers for local static/extern,Fariborz Jahanian2008-11-203-19/+51
| | | | | | | diagnostics on use of __weak attribute on fields, Early support for read/write barriers for objc fields. llvm-svn: 59682
* Implement the rest of C++ [over.call.object], which permits the objectDouglas Gregor2008-11-193-10/+170
| | | | | | | | | | being called to be converted to a reference-to-function, pointer-to-function, or reference-to-pointer-to-function. This is done through "surrogate" candidate functions that model the conversions from the object to the function (reference/pointer) and the conversions in the arguments. llvm-svn: 59674
* Use PreprocessorLexer::getFileID() instead of Lexer::getFileLoc(). This is ↵Ted Kremenek2008-11-193-7/+7
| | | | | | an intermediate step to having getCurrentLexer() return a PreprocessorLexer* instead of a Lexer*. llvm-svn: 59672
* Move more cases of using 'CurLexer' to 'CurPPLexer'.Ted Kremenek2008-11-193-27/+38
| | | | | | Use PTHLexer::isNextPPTokenLParen() when using the PTHLexer. llvm-svn: 59671
* Add stub for PTHLexer::isNextPPTokenLParen().Ted Kremenek2008-11-191-1/+6
| | | | llvm-svn: 59670
* When using a PTHLexer, use DiscardToEndOfLine() instead of ReadToEndOfLine().Ted Kremenek2008-11-194-7/+20
| | | | llvm-svn: 59668
* - Move static function IsNonPragmaNonMacroLexer into Preprocessor.h.Ted Kremenek2008-11-195-24/+21
| | | | | | | | | | | | | - Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry (simplifies some uses). - Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile. - Add 'FileID' to PreprocessorLexer, and have Preprocessor query this fileid when looking up the FileEntry for a file Performance testing of -Eonly on Cocoa.h shows no performance regression because of this patch. llvm-svn: 59666
* Support for calling overloaded function call operators (operator())Douglas Gregor2008-11-193-1/+160
| | | | | | | | | | | | | | with function call syntax, e.g., Functor f; f(x, y); This is the easy part of handling calls to objects of class type (C++ [over.call.object]). The hard part (coping with conversions from f to function pointer or reference types) will come later. Nobody uses that stuff anyway, right? :) llvm-svn: 59663
* Some tweaks suggested by ArgirisDouglas Gregor2008-11-193-29/+28
| | | | llvm-svn: 59661
* CMake: Added some source files.Oscar Fuentes2008-11-192-0/+3
| | | | | | Patch contributed by Jay Foad! llvm-svn: 59656
* More of objective-c's gc code-gen. Treat objective-cFariborz Jahanian2008-11-192-3/+10
| | | | | | objects as __strong when attribute unspecified. llvm-svn: 59654
* Make DeclContext::getLexicalParent reuse DeclContext::getParent.Argyrios Kyrtzidis2008-11-191-4/+1
| | | | llvm-svn: 59651
* Take care another assert:Argyrios Kyrtzidis2008-11-192-3/+12
| | | | | | | | | | | | | | | | | | | | struct A { struct B; }; struct A::B { void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one." }; Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g: namespace A { struct S; } struct A::S {}; // getParent() == namespace 'A' // getLexicalParent() == translation unit llvm-svn: 59650
* fix folding of '*doubleArray'Nuno Lopes2008-11-191-0/+3
| | | | llvm-svn: 59647
* Make the non-const DeclContext::getParent call the const version, instead of ↵Argyrios Kyrtzidis2008-11-191-3/+3
| | | | | | the other way around. llvm-svn: 59646
* Few more changes due to Daniel's feedback.Fariborz Jahanian2008-11-193-19/+26
| | | | llvm-svn: 59645
* Support overloading of the subscript operator[], including support forDouglas Gregor2008-11-194-5/+94
| | | | | | | | | built-in operator candidates. Test overloading of '&' and ','. In C++, a comma expression is an lvalue if its right-hand subexpression is an lvalue. Update Expr::isLvalue accordingly. llvm-svn: 59643
OpenPOWER on IntegriCloud