summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Refactor our handling of expression evaluation contexts, so that SemaDouglas Gregor2009-11-264-40/+80
| | | | | | | | | | | | maintains a stack of evaluation contexts rather than having the parser do it. This change made it simpler to track in which contexts temporaries were created, so that we could... "Forget" about temporaries created within unevaluated contexts, so that we don't build a CXXExprWithTemporaries and, therefore, destroy the integral-constness of our expressions. Fixes PR5609. llvm-svn: 89908
* Add missing case in switch statement.Ted Kremenek2009-11-251-1/+2
| | | | llvm-svn: 89903
* Refine MemRegions for blocks. Add a new region calledTed Kremenek2009-11-255-7/+43
| | | | | | | | | | | 'BlockDataRegion' to distinguish between the code associated with a block (which is represented by 'BlockTextRegion') and an instance of a block, which includes both code and data. 'BlockDataRegion' has an associated LocationContext, which can be used to eventually model the lifetime of a block object once LocationContexts can represent scopes (and iterations around a loop, etc.). llvm-svn: 89900
* Remove recently added FIXME. The appropriate FIXME is already in ↵Ted Kremenek2009-11-251-2/+0
| | | | | | MemRegionManager::getVarRegion(). llvm-svn: 89897
* Allow user re-definition of SEL as well as accessing its fields.Fariborz Jahanian2009-11-256-5/+26
| | | | | | This fixes pr5611. llvm-svn: 89895
* Fix attribute between function decl ')' and '{' or '=0'John Thompson2009-11-251-0/+7
| | | | llvm-svn: 89894
* Add FIXME.Ted Kremenek2009-11-251-0/+2
| | | | llvm-svn: 89892
* Implement the rules in C++ [basic.link] and C99 6.2.2 for computingDouglas Gregor2009-11-252-9/+200
| | | | | | | | | | | the linkage of a declaration. Switch the lame (and completely wrong) NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(), along with the "can this declaration be a template argument?" check that started all of this. Fixes -fsyntax-only for PR5597. llvm-svn: 89891
* Add post-visit Checker support in GRExprEngine for BlockExpr.Ted Kremenek2009-11-251-1/+7
| | | | llvm-svn: 89890
* Add a new RetainReleaseChecker class (that subclasses CheckerVisitor) to ↵Ted Kremenek2009-11-251-0/+22
| | | | | | extend the functionality of the retain/release checker using the new Checker interface. Pieces of CFRefCount will gradually be migrated to this new class over time. llvm-svn: 89889
* Move RegisterChecks() to the end of the file. No functionality change.Ted Kremenek2009-11-251-57/+59
| | | | llvm-svn: 89888
* Call GRExprEngine::setTransferFunctions() after registering all Checkers. ↵Ted Kremenek2009-11-251-2/+2
| | | | | | This allows GRTransferFuncs::RegisterChecks() to always be called after all checkers have been registered. llvm-svn: 89887
* Consolidate logic in ActionInlineCall by having it call ActionGRExprEngine ↵Ted Kremenek2009-11-251-19/+3
| | | | | | instead of replicating most of its logic (and missing pieces). llvm-svn: 89886
* Better diagnostic on deleted constructor when noFariborz Jahanian2009-11-251-2/+5
| | | | | | initializer name is available. llvm-svn: 89885
* Make RegisterInternalChecks() part of GRExprEngine's private implementation ↵Ted Kremenek2009-11-252-31/+32
| | | | | | by making it a static function within GRExprEngine.cpp. llvm-svn: 89884
* Register internal checks with GRExprEngine when it is constructed, not ↵Ted Kremenek2009-11-252-3/+5
| | | | | | manually in AnalysisConsumer.cpp. llvm-svn: 89883
* When dispatching to Checker objects in GRExprEngine::CheckerVisit(),Ted Kremenek2009-11-251-4/+12
| | | | | | | | | only stop processing the checkers after all the nodes for a current check have been processed. This (I believe) handles the case where PredSet (the input nodes) contains more than one node due to state bifurcation. Zhongxing: can you review this? llvm-svn: 89882
* Implement support for default template arguments of function templates.Douglas Gregor2009-11-253-16/+108
| | | | llvm-svn: 89874
* Diagnose ill-formed uses of default template arguments inDouglas Gregor2009-11-254-7/+107
| | | | | | | | | | | function templates (in C++98), friend function templates, and out-of-line definitions of members of class templates. Also handles merging of default template arguments from previous declarations of function templates, for C++0x. However, we don't yet make use of those default template arguments. llvm-svn: 89872
* Use StringRef (again) in DebugInfo interface.Devang Patel2009-11-251-18/+18
| | | | llvm-svn: 89867
* Fix a thinko where we weren't always performing unary conversions on the ↵Douglas Gregor2009-11-251-4/+4
| | | | | | switch condition, fixing PR5612 llvm-svn: 89864
* What the FIXMEs want, the FIXMEs shall have.Daniel Dunbar2009-11-252-57/+31
| | | | llvm-svn: 89861
* Add an arg_iterator, for iterating over a subset of arguments in an ArgList.Daniel Dunbar2009-11-251-72/+40
| | | | llvm-svn: 89860
* Fix some uses of fprintf/stderr without a prototype.Daniel Dunbar2009-11-251-2/+2
| | | | llvm-svn: 89858
* Add clang -cc1 parsing for frontend options.Daniel Dunbar2009-11-252-1/+136
| | | | llvm-svn: 89856
* Add clang -cc1 parsing for preprocessor output options (-E).Daniel Dunbar2009-11-251-0/+6
| | | | llvm-svn: 89854
* Don't pass -fexceptions=0 (it is the default).Daniel Dunbar2009-11-251-8/+4
| | | | llvm-svn: 89853
* Fix for Path::isSpecialFile to Path::isRegularFile API in rev 89765.Edward O'Callaghan2009-11-251-1/+1
| | | | llvm-svn: 89849
* When the condition of a switch() statement is semantically invalid,Douglas Gregor2009-11-252-9/+8
| | | | | | | still parse the body of the switch to try to avoid spurious diagnostics. Fixes PR5606. llvm-svn: 89847
* Don't crash when we re-use a template specialization node for an explicit ↵Douglas Gregor2009-11-251-5/+9
| | | | | | instantiation. lib/Support/CommandLine.cpp is our test case llvm-svn: 89845
* Refactor ActOnFinishSwitchStmt to simplify it furtherDouglas Gregor2009-11-251-14/+6
| | | | llvm-svn: 89843
* Refactor ActOnFinishSwitchStmt to simplify and reduce nestingDouglas Gregor2009-11-251-93/+106
| | | | llvm-svn: 89842
* Parse C++ member check attributes - base_check, hiding, and override.Alexis Hunt2009-11-255-50/+146
| | | | | | The attributes are currently ignored. llvm-svn: 89837
* Add VTT parameter to base ctors/dtors with virtual bases. (They aren't used ↵Anders Carlsson2009-11-255-6/+86
| | | | | | yet). llvm-svn: 89835
* Implement proper cleanup semantics for condition variables in forDouglas Gregor2009-11-251-11/+34
| | | | | | | | | | statements, e.g., for(; X x = X(); ) { ... } Daniel or Anders, please review! llvm-svn: 89832
* Add really basic support for blocks in the retain/release checker. For now, ↵Ted Kremenek2009-11-251-3/+14
| | | | | | anytime we pass a tracked object to a block call we stop tracking it. llvm-svn: 89831
* Allow building of CFGs for ASTs that contain BlockExprs.Ted Kremenek2009-11-251-3/+6
| | | | llvm-svn: 89830
* Add transfer function support for BlockExpr.Ted Kremenek2009-11-251-0/+12
| | | | llvm-svn: 89829
* Split CodeTextRegion into FunctionTextRegion and BlockTextRegion. This a ↵Ted Kremenek2009-11-256-16/+49
| | | | | | precursor to having basic static analysis support for blocks. llvm-svn: 89828
* Some fancy footwork to move the decision on how Fariborz Jahanian2009-11-254-18/+25
| | | | | | to build casted expression-list AST to Sema. llvm-svn: 89827
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-2518-262/+264
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* Have the parser tell sema whether a member declaration is a function ↵Sebastian Redl2009-11-244-4/+7
| | | | | | definition. This allows sema to not emit spurious diagnostics in some invalid code. llvm-svn: 89816
* For the nil-receiver checker, take into account the behavioral changes that ↵Ted Kremenek2009-11-241-6/+19
| | | | | | got introduced in Mac OS X 10.5 and later, notably return values of double, float, etc., will not be garbage. Fixes <rdar://problem/6829160>. llvm-svn: 89809
* Cleanups and fixes to the nil-receiver checker, some of it fallout theTed Kremenek2009-11-242-114/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | initial transition of the nil-receiver checker to the Checker interface as done in r89745. Some important changes include: 1) We consolidate the BugType object used for nil receiver bug reports, and don't include the type of the returned value in the BugType (which would be wrong if a nil receiver bug was reported more than once) 2) Added a new (temporary) flag to CheckerContext: DoneEvauating. This is used by GRExprEngine when evaluating message expressions to not continue evaluating the message expression if this flag is set. This flag is currently set by the nil receiver checker. This is an intermediate solution to allow the nil-receiver checker to properly work as a plug-in outside of GRExprEngine. Basically, this flag indicates that the entire message expression has been evaluated, not just a precondition (which is what the nil-receiver checker does). This flag *should not* be repurposed for general use, but just to pull more things out of GRExprEngine that already in there as we devise a better interface in the Checker class. 3) Cleaned up the logic in the nil-receiver checker, making the control-flow a lot easier to read. llvm-svn: 89804
* Refactor argument collection of constructor calls usingFariborz Jahanian2009-11-244-52/+14
| | | | | | the common routine. llvm-svn: 89802
* "Do" loops cannot have condition variables, so don't parse them.Douglas Gregor2009-11-241-4/+3
| | | | llvm-svn: 89801
* Clean up the AST for while loops and fix several problems withDouglas Gregor2009-11-246-11/+91
| | | | | | | | | | | | | | | | | cleanups for while loops: 1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g., while (shared_ptr<WorkInt> p = getWorkItem()) { // ... } 2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g., while (blah) RAIIObject raii(blah+1); llvm-svn: 89800
* Handle references correctly when synthesizing copy constructors.Anders Carlsson2009-11-241-8/+28
| | | | | | | | | | | With this change, the clang-on-clang test result is now Expected Passes : 224 Unexpected Failures: 37 Which means that we can compile over 80% of clang with clang! :) llvm-svn: 89799
* Fix some major problems dealing with dependently-qualified names in implicitJohn McCall2009-11-241-4/+11
| | | | | | member-reference contexts. Fixes some clang-on-clang asserts. llvm-svn: 89796
* More cleanup of argument call collection.Fariborz Jahanian2009-11-243-20/+26
| | | | llvm-svn: 89789
OpenPOWER on IntegriCloud