aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2010-12-04Although we currently have explicit lvalue-to-rvalue conversions, they'reJohn McCall
not actually frequently used, because ImpCastExprToType only creates a node if the types differ. So explicitly create an ICE in the lvalue-to-rvalue conversion code in DefaultFunctionArrayLvalueConversion() as well as several other new places, and consistently deal with the consequences throughout the compiler. In addition, introduce a new cast kind for loading an ObjCProperty l-value, and make sure we emit those nodes whenever an ObjCProperty l-value appears that's not on the LHS of an assignment operator. This breaks a couple of rewriter tests, which I've x-failed until future development occurs on the rewriter. Ted Kremenek kindly contributed the analyzer workarounds in this patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-02Fix range in printf warnings for invalid conversion specifiers.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Let StackFrameContext represent if the call expr is evaluated as lvalue.Zhongxing Xu
This is required for supporting const reference to temporary objects. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24print asLValue attribute of CFGStmt.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-24Refactor AddStmtChoice to make it easier to use; also add comments on how ↵Zhanyong Wan
the class works. Reviewed by kremenek. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120080 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22Stylistic changes to CFG.cpp:Zhanyong Wan
1. "no 'else' after 'return'" -- this is for conformance with the coding standards. 2. move 'else' to the line of the previous '}' -- this is for consistency. Reviewed by kremenek. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119983 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-22Fix PR8419. Reviewed by kremenek and xuzhongxing.Zhanyong Wan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119960 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-21The 'X' printf type has a valid alternative form. Fixes PR8641.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119946 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Remove invalid assertion from CFG builder. When building the CFG pieces for ↵Ted Kremenek
a ternary '?' expression, it is possible for the confluence block to only have a single predecessor due to calls to 'noreturn' functions. Fixes assertion failure reported in PR 8619. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-14Revert r118991.Zhongxing Xu
Elidable CXXConstructExpr should inhibit calling destructor for temporary that is copied, not the one created. This is because eliding copy constructor means that the object that was to be copied will be constructed directly in memory the copy would be constructed in. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119044 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-13Do not add implicit dtors for CXXBindTemporaryExpr with elidable Zhongxing Xu
CXXConstructExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-06Don't warn when matching %p to nullptr.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03Do not add elidable CXXConstructExpr as block-level expr.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-03Added generating destructors for temporary objects. Two cases I know of, ↵Marcin Swiderski
that are not handled properly: 1. For statement: const C& c = C(0) ?: C(1) destructors generated for condition will not differ from those generated for case without prolonged lifetime of temporary, 2. There will be no destructor for constant reference member bound to temporary at the exit from constructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01Explicitly handle CXXBindTemporaryExpr, CXXFunctionalCastExpr, Zhongxing Xu
and ImplicitCastExpr to propagate asLValue AddStmtChoice property. But do not propagate AlwaysAdd property. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-01Make all CXXConstructExpr's block-level expressions. This is required by Zhongxing Xu
method inlining. Temporarily fail a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-29Added CFGTerminator class, that holds information about CFGBlock terminator ↵Marcin Swiderski
statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117642 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-27If visiting RHS causes us to finish 'Block', e.g. the RHS is a StmtExprZhongxing Xu
containing a DoStmt, and the LHS doesn't create a new block, then we should return RBlock. Otherwise we'll incorrectly return NULL. Also relax an assertion in VisitWhileStmt(). Reset 'Block' when it is finished. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25Added generation of destructors for member constant size arrays.Marcin Swiderski
There's only one destructor call generated for each not empty array (at least for now this should be enough). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-25Added generation of destructors for constant size arrays.Marcin Swiderski
There's only one destructor call generated for each not empty array (at least for now this should be enough). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-24- Fixed subexpressions evaluation order for binary operators to match order ↵Marcin Swiderski
in code generated with the compiler, - Fixed test cases for unreachable code warnings produced by Sema. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117220 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21Previously, the printf warnings would say your arguments type was 'int' when ↵Ted Kremenek
it was really a 'char' or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints. Patch by Justin Bogner! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116996 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15Death to blocks, or at least the word "block" in one particular obnoxiouslyJohn McCall
ambiguous context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05* Simplify codeZhongxing Xu
* Fix dump() to make it consistent with the test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05Added support for base and member destructors in destructor.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04Added support for C++ initializers in CFG.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Now the whether adding implicit dtors is controlled by cmd option.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115275 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01The return value is never used.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Use default augument.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Simplify interface for addLocalScopeForStmt().Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01The old logic would add non-struct and non C++ struct variables to the localZhongxing Xu
scope. Now we only add C++ struct with non-trivial destructor variables to the local scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for exception variable in catch statement.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115266 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for init statement, condition variable ↵Marcin Swiderski
and implicit scope in for statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115265 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01dded generating CFGAutomaticObjDtors for condition variable and implicit ↵Marcin Swiderski
scopes in switch statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115264 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for condition variable and implicit ↵Marcin Swiderski
scopes in while and do statements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115262 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added generating CFGAutomaticObjDtors for condition variable and implicit ↵Marcin Swiderski
scopes in if statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115256 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Fixed checking for trivial destructor in ↵Marcin Swiderski
CFGBuilder::addLocalScopeForVarDecl. Checked type does not have to represent C++ class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01Added:Marcin Swiderski
- Adding LocalScope for CompoundStmt, - Adding CFGAutomaticObjDtors for end of scope, return, goto, break, continue, - Regression tests for above cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added methods for adding LocalScopes and CFGAutomaticObjDtors.Marcin Swiderski
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115237 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added methods for inserting CFGAutomaticObjDtors to CFGBlocks,Marcin Swiderski
Fixed some misspells in comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added:Marcin Swiderski
- post-increament, distance and bool conversion methods to LocalScope::const_iterator, - adding VarDecl to LocalScope. Fixed some misspells in comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added two new command line arguments:Marcin Swiderski
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true, -cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25In preparation for adding generation of destructors for objects with ↵Marcin Swiderski
automatic storage added: - LocalScope class with iterator used to pointing into it, - fat doxygen comment for LocalScope indended usage, - BlockScopePosPair class used for storing jump targets/sources (for: goto, break, continue), that replaces raw CFGBlock pointer used earlier for this purpose. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21Added:Marcin Swiderski
- definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor, - support for above classes to print_elem function (renamed print_stmt), - support for VarDecls in StmtPrinterHelper. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Tidy up.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu
and discussions with Ted and Jordy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15Relax assertion in CFG builder when processing ForStmts. This fixes an ↵Ted Kremenek
assertion failure on code containing GNU statement expressions reported in PR 8141. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113953 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14Add CFG::BuildOptions class to pass in CFG builder options under on ↵Ted Kremenek
parameter. Patch by Marcin Świderski! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14Fix CFGBuilder crash reported in PR 8141.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer
instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8