summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* fix test. it now crashes, but thats another problem..Nuno Lopes2008-11-181-2/+2
| | | | llvm-svn: 59537
* Add some quick notes on the clang tests and running the LLVM testDaniel Dunbar2008-11-181-0/+19
| | | | | | suite with clang. llvm-svn: 59536
* Input files should be before link options.Daniel Dunbar2008-11-181-1/+1
| | | | | | | | - PR3094. - No test case, ccc is not really a supported product (llvmc2 already got this right). llvm-svn: 59535
* add testcase for PR3093Torok Edwin2008-11-181-0/+3
| | | | llvm-svn: 59534
* don't dereference a null pointerChris Lattner2008-11-181-0/+1
| | | | llvm-svn: 59533
* As threatened previously: consolidate name lookup and the creation ofDouglas Gregor2008-11-185-84/+49
| | | | | | | | | | | | | | DeclRefExprs and BlockDeclRefExprs into a single function Sema::ActOnDeclarationNameExpr, eliminating a bunch of duplicate lookup-name-and-check-the-result code. Note that we still have the three parser entry points for identifiers, operator-function-ids, and conversion-function-ids, since the parser doesn't (and shouldn't) know about DeclarationNames. This is a Good Thing (TM), and there will be more entrypoints coming (e.g., for C++ pseudo-destructor expressions). llvm-svn: 59527
* Extend DeclarationName to support C++ overloaded operators, e.g.,Douglas Gregor2008-11-1818-105/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | operator+, directly, using the same mechanism as all other special names. Removed the "special" identifiers for the overloaded operators from the identifier table and IdentifierInfo data structure. IdentifierInfo is back to representing only real identifiers. Added a new Action, ActOnOperatorFunctionIdExpr, that builds an expression from an parsed operator-function-id (e.g., "operator +"). ActOnIdentifierExpr used to do this job, but operator-function-ids are no longer represented by IdentifierInfo's. Extended Declarator to store overloaded operator names. Sema::GetNameForDeclarator now knows how to turn the operator name into a DeclarationName for the overloaded operator. Except for (perhaps) consolidating the functionality of ActOnIdentifier, ActOnOperatorFunctionIdExpr, and ActOnConversionFunctionExpr into a common routine that builds an appropriate DeclRefExpr by looking up a DeclarationName, all of the work on normalizing declaration names should be complete with this commit. llvm-svn: 59526
* Fix 80-col violation.Zhongxing Xu2008-11-181-1/+1
| | | | llvm-svn: 59523
* Add test cast for struct array.Zhongxing Xu2008-11-181-0/+4
| | | | llvm-svn: 59522
* handle the case that the array element is of structure type when bind the ↵Zhongxing Xu2008-11-181-1/+4
| | | | | | whole array to a single value (for example, UnknownVal, UndefinedVal). llvm-svn: 59521
* remove one more Preprocessor::Diag method.Chris Lattner2008-11-184-15/+16
| | | | llvm-svn: 59512
* Convert the lexer and start converting the PP over to using canonical Diag ↵Chris Lattner2008-11-186-39/+60
| | | | | | methods. llvm-svn: 59511
* remove the last couple obsolete forms of Parser::Diag.Chris Lattner2008-11-184-23/+8
| | | | llvm-svn: 59510
* Change a couple of the Parser::Diag methods to return DiagnosticInfoChris Lattner2008-11-188-115/+105
| | | | | | | | | and let the clients push whatever they want into the DiagnosticInfo instead of hard coding a few forms. Also switch various clients to use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the canonical form to simplify the code a bit. llvm-svn: 59509
* The 'return Diag(...)' idiom should be treated as returning an Chris Lattner2008-11-181-0/+3
| | | | | | invalid expr/stmt, etc. llvm-svn: 59508
* Give DiagnosticInfo a real copy constructor, even though itChris Lattner2008-11-181-3/+3
| | | | | | is destructive. llvm-svn: 59507
* alphabeticalize.Chris Lattner2008-11-181-1/+1
| | | | llvm-svn: 59506
* Updated checker build.Ted Kremenek2008-11-181-1/+1
| | | | llvm-svn: 59503
* This reworks some of the Diagnostic interfaces a bit to change how diagnosticsChris Lattner2008-11-1817-205/+241
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are formed. In particular, a diagnostic with all its strings and ranges is now packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a ton of random stuff. This has the benefit of simplifying the interface, making it more extensible, and allowing us to do more checking for things like access past the end of the various arrays passed in. In addition to introducing DiagnosticInfo, this also substantially changes how Diagnostic::Report works. Instead of being passed in all of the info required to issue a diagnostic, Report now takes only the required info (a location and ID) and returns a fresh DiagnosticInfo *by value*. The caller is then free to stuff strings and ranges into the DiagnosticInfo with the << operator. When the dtor runs on the DiagnosticInfo object (which should happen at the end of the statement), the diagnostic is actually emitted with all of the accumulated information. This is a somewhat tricky dance, but it means that the accumulated DiagnosticInfo is allowed to keep pointers to other expression temporaries without those pointers getting invalidated. This is just the minimal change to get this stuff working, but this will allow us to eliminate the zillions of variant "Diag" methods scattered throughout (e.g.) sema. For example, instead of calling: Diag(BuiltinLoc, diag::err_overload_no_match, typeNames, SourceRange(BuiltinLoc, RParenLoc)); We will soon be able to just do: Diag(BuiltinLoc, diag::err_overload_no_match) << typeNames << SourceRange(BuiltinLoc, RParenLoc)); This scales better to support arbitrary types being passed in (not just strings) in a type-safe way. Go operator overloading?! llvm-svn: 59502
* Attribute nonnull can be applied to block pointers.Ted Kremenek2008-11-181-3/+6
| | | | llvm-svn: 59499
* SourceManager::getLineNumber is logically const except for caching.Chris Lattner2008-11-182-8/+8
| | | | | | Use mutable to make it so. llvm-svn: 59498
* eliminate dependence of strange "Diagnostic::Report" method, Chris Lattner2008-11-181-4/+6
| | | | | | delete huge trailing whitespace to fit in 80 cols. llvm-svn: 59497
* remove a helper method with only one call site.Chris Lattner2008-11-182-9/+1
| | | | llvm-svn: 59495
* Change the diagnostics interface to take an array of pointers to Chris Lattner2008-11-1814-34/+42
| | | | | | | | strings instead of array of strings. This reduces string copying in some not-very-important cases, but paves the way for future improvements. llvm-svn: 59494
* cleanups.Chris Lattner2008-11-181-2/+1
| | | | llvm-svn: 59493
* sort files.Chris Lattner2008-11-181-4/+4
| | | | llvm-svn: 59492
* cleanups and simplifications.Chris Lattner2008-11-181-11/+7
| | | | llvm-svn: 59491
* Preprocessor::PushIncludeMacroStack() should always zero out CurPPLexer.Ted Kremenek2008-11-181-0/+1
| | | | llvm-svn: 59490
* - Add Lexer::isPragma() accessor for clients of Lexer that aren't friends.Ted Kremenek2008-11-182-8/+17
| | | | | | | | | - Add static method to test if the current lexer is a non-macro/non-pragma lexer. - Refactor some code in PPLexerChange to use this static method. - No performance change. llvm-svn: 59486
* minor cleanups and tidying, no functionality change.Chris Lattner2008-11-182-69/+71
| | | | llvm-svn: 59485
* implement a fixme by making warnings for ++/-- on non-modifiable-lvalues better.Chris Lattner2008-11-183-11/+4
| | | | llvm-svn: 59484
* factor some code out into a helper functionChris Lattner2008-11-181-34/+48
| | | | llvm-svn: 59483
* Replace more uses of 'CurLexer->' with 'CurPPLexer->'. No performance change.Ted Kremenek2008-11-182-5/+5
| | | | llvm-svn: 59482
* Add hooks to use PTHLexer::Lex instead of Lexer::Lex when CurLexer is null.Ted Kremenek2008-11-182-3/+7
| | | | | | | Performance tests on Cocoa.h (using the regular Lexer) shows no performance difference. llvm-svn: 59479
* Update Xcode project.Ted Kremenek2008-11-181-0/+6
| | | | llvm-svn: 59478
* Added conditional guard 'if (CurLexer)' when using SetCommentRetentionState().Ted Kremenek2008-11-181-6/+6
| | | | | | | | | | | | This is because the PTHLexer will not support this method. Performance testing on preprocessing Cocoa.h shows that this results in a negligible performance difference (less than 1%). I tried making Lexer::SetCommentRetentionState() an out-of-line function (a precursor to making it a virtual function in PreprocessorLexer) and noticed a 1% decrease in speed (it is called in a hot part of the Preprocessor). llvm-svn: 59477
* Change a bunch of uses of 'CurLexer->' to 'CurPPLexer->', which should be theTed Kremenek2008-11-181-40/+40
| | | | | | | | alias for the current PreprocessorLexer. No functionality change. Performance testing shows this results in no performance degradation when preprocessing Cocoa.h. llvm-svn: 59474
* - Add 'CurPPLexer' to Preprocessor to keep track of the currentTed Kremenek2008-11-182-9/+31
| | | | | | | | | PreprocessorLexer, which will either be a 'Lexer' or 'PTHLexer'. - Added stub field 'CurPTHLexer' to keep track of the current PTHLexer. - Modified IncludeStackInfo to track both the current PTHLexer and current PreprocessorLexer. llvm-svn: 59472
* Implement effects of 'mutable', and a few comments from Chris on its parsing.Sebastian Redl2008-11-176-6/+32
| | | | llvm-svn: 59470
* Eliminate all of the placeholder identifiers used for constructors,Douglas Gregor2008-11-1718-167/+160
| | | | | | | | | destructors, and conversion functions. The placeholders were used to work around the fact that the parser and some of Sema really wanted declarators to have simple identifiers; now, the code that deals with declarators will use DeclarationNames. llvm-svn: 59469
* Fold assertion into second valid else branch. This removes a compiler warningTed Kremenek2008-11-171-3/+2
| | | | | | | | where the control reaches the end of a non-void function and also allows the compiler to generate better code. When this assertion is false we can easily add more else cases. llvm-svn: 59468
* Fix <rdar://problem/6333904> [sema] message lookup on super is incorrectSteve Naroff2008-11-173-1/+43
| | | | | | Missing special lookup rule in Sema::ActOnInstanceMessage(). llvm-svn: 59467
* Only test test/CodeGenObjC/synchronized.m as a i686-apple-darwin8 targetDouglas Gregor2008-11-171-1/+2
| | | | llvm-svn: 59463
* Updated IdentifierResolver to deal with DeclarationNames. The names ofDouglas Gregor2008-11-1716-70/+223
| | | | | | | | | | | | | | | | | | | | | C++ constructors, destructors, and conversion functions now have a FETokenInfo field that IdentifierResolver can access, so that these special names are handled just like ordinary identifiers. A few other Sema routines now use DeclarationNames instead of IdentifierInfo*'s. To validate this design, this code also implements parsing and semantic analysis for id-expressions that name conversion functions, e.g., return operator bool(); The new parser action ActOnConversionFunctionExpr takes the result of parsing "operator type-id" and turning it into an expression, using the IdentifierResolver with the DeclarationName of the conversion function. ActOnDeclarator pushes those conversion function names into scope so that the IdentifierResolver can find them, of course. llvm-svn: 59462
* Implement rdar://6319320: give a good diagnostic for cases where peopleChris Lattner2008-11-176-2/+22
| | | | | | | are trying to use the old GCC "casts as lvalue" extension. We don't and will hopefully never support this. llvm-svn: 59460
* Fix <rdar://problem/6316324> [sema] spurious warning on comparison of ↵Steve Naroff2008-11-172-2/+10
| | | | | | qualified id. llvm-svn: 59459
* Updated checker build.Ted Kremenek2008-11-171-1/+1
| | | | llvm-svn: 59457
* Test case for objective-c's @synchronized statement.Fariborz Jahanian2008-11-171-0/+11
| | | | llvm-svn: 59451
* Add TODO item for adding more source-range information to declaratorsDouglas Gregor2008-11-171-0/+21
| | | | llvm-svn: 59446
* Fix <rdar://problem/6320086> parser rejects block capturing ivar.Steve Naroff2008-11-172-1/+23
| | | | llvm-svn: 59444
OpenPOWER on IntegriCloud