summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/ReachableCode.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the CFGElement "Invalid" state.David Blaikie2013-02-231-2/+2
| | | | | | | | | | | | | Use Optional<CFG*> where invalid states were needed previously. In the one case where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy CFGAutomaticObjDtor. Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek and Doug Gregor. Post commit code review feedback on r175796 by Ted Kremenek. llvm-svn: 175938
* Replace CFGElement llvm::cast support to be well-defined.David Blaikie2013-02-211-2/+2
| | | | | | See r175462 for another example/more details. llvm-svn: 175796
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-2/+2
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Dont cast away const needlessly. Found by gcc48 -Wcast-qual.Roman Divacky2012-09-061-2/+2
| | | | llvm-svn: 163325
* Unweaken vtables as per ↵David Blaikie2011-12-201-1/+3
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
* Rename AnalysisContext to AnalysisDeclContext. Not only is this name more ↵Ted Kremenek2011-10-241-1/+1
| | | | | | accurate, but it frees up the name AnalysisContext for other uses. llvm-svn: 142782
* Teach -Wunreachable-code about dead code caused by macro expansions. This ↵Ted Kremenek2011-08-251-4/+8
| | | | | | should suppress false positives resulting from 'assert' and friends. llvm-svn: 138576
* Start reworking -Wunreachable-code. The original analysis had serious flaws ↵Ted Kremenek2011-08-231-172/+201
| | | | | | | | | | with how it handled SCC's of dead code, or simply having false negatives by overly suppressing warnings. WIP. llvm-svn: 138410
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-4/+4
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Automatic Reference Counting.John McCall2011-06-151-0/+6
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a ↵Nico Weber2011-04-021-1/+1
| | | | | | non-header file. llvm-svn: 128780
* In preparation for fixing PR 6884, rework CFGElement to have getAs<> return ↵Ted Kremenek2011-03-011-4/+4
| | | | | | | | | pointers instead of fresh CFGElements. - Also, consoldiate getDtorKind() and getKind() into one "kind". - Add empty getDestructorDecl() method to CFGImplicitDtor. llvm-svn: 126738
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* Remove a kludge from analysis based warnings that used to detectChandler Carruth2011-01-081-3/+2
| | | | | | | | | | | | | | | | temporaries with no-return destructors. The CFG now properly supports temporaries and implicit destructors which both makes this kludge no longer work, and conveniently removes the need for it. Turn on CFG handling of implicit destructors and initializers. Several ad-hoc benchmarks don't indicate any measurable performance impact from growing the CFG, and it fixes real correctness problems with warnings. As a result of turning on these CFG elements, we started to tickle an inf-loop in the unreachable code logic used for warnings. The fix is trivial. llvm-svn: 123056
* Start migration of static analyzer to using theTed Kremenek2010-12-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit lvalue-to-rvalue casts that John McCall recently introduced. This causes a whole bunch of logic in the analyzer for handling lvalues to vanish. It does, however, raise a few issues in the analyzer w.r.t to modeling various constructs (e.g., field accesses to compound literals). The .c/.m analysis test cases that fail are due to a missing lvalue-to-rvalue cast that will get introduced into the AST. The .cpp failures were more than I could investigate in one go, and the patch was already getting huge. I have XFAILED some of these tests, and they should obviously be further investigated. Some highlights of this patch include: - CFG no longer requires an lvalue bit for CFGElements - StackFrameContext doesn't need an 'asLValue' flag - The "VisitLValue" path from GRExprEngine has been eliminated. Besides the test case failures (XFAILed), there are surely other bugs that are fallout from this change. llvm-svn: 121960
* Added CFGTerminator class, that holds information about CFGBlock terminator ↵Marcin Swiderski2010-10-291-1/+2
| | | | | | statement. llvm-svn: 117642
* Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu2010-09-161-5/+9
| | | | | | and discussions with Ted and Jordy. llvm-svn: 114056
* Enhance -Wunreachable-code to not consider the 'default:' branch of a switch ↵Ted Kremenek2010-09-091-5/+11
| | | | | | | | statement live if a switch on an enum value has explicit 'case:' statements for each enum value. llvm-svn: 113451
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-1/+1
| | | | | | to the new constants. llvm-svn: 112047
* Move the rest of the unreachable code analysis from libSemaTed Kremenek2010-02-231-9/+235
| | | | | | to libAnalysis (with only the error reporting in libSema). llvm-svn: 96893
* Start moving some of the logic for the unreachable code analysis out of libSemaTed Kremenek2010-02-231-0/+52
and into libAnalysis. llvm-svn: 96872
OpenPOWER on IntegriCloud