aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Analysis/ReachableCode.cpp
AgeCommit message (Collapse)AuthorFilesLines
2013-01-12Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko1-2/+2
brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-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
2012-09-06Dont cast away const needlessly. Found by gcc48 -Wcast-qual.Roman Divacky1-2/+2
llvm-svn: 163325
2011-12-20Unweaken vtables as per ↵David Blaikie1-1/+3
http://llvm.org/docs/CodingStandards.html#ll_virtual_anch llvm-svn: 146959
2011-10-24Rename AnalysisContext to AnalysisDeclContext. Not only is this name more ↵Ted Kremenek1-1/+1
accurate, but it frees up the name AnalysisContext for other uses. llvm-svn: 142782
2011-08-25Teach -Wunreachable-code about dead code caused by macro expansions. This ↵Ted Kremenek1-4/+8
should suppress false positives resulting from 'assert' and friends. llvm-svn: 138576
2011-08-23Start reworking -Wunreachable-code. The original analysis had serious flaws ↵Ted Kremenek1-172/+201
with how it handled SCC's of dead code, or simply having false negatives by overly suppressing warnings. WIP. llvm-svn: 138410
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-4/+4
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-06-15Automatic Reference Counting.John McCall1-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
2011-04-02Make -Wheader-hygiene not complain about USING_NAMESPACE_THROUGH_MACRO in a ↵Nico Weber1-1/+1
non-header file. llvm-svn: 128780
2011-03-01In preparation for fixing PR 6884, rework CFGElement to have getAs<> return ↵Ted Kremenek1-4/+4
pointers instead of fresh CFGElements. - Also, consoldiate getDtorKind() and getKind() into one "kind". - Add empty getDestructorDecl() method to CFGImplicitDtor. llvm-svn: 126738
2011-02-17Change the representation of GNU ?: expressions to use a different expressionJohn McCall1-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
2011-01-08Remove a kludge from analysis based warnings that used to detectChandler Carruth1-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
2010-12-16Start migration of static analyzer to using theTed Kremenek1-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
2010-10-29Added CFGTerminator class, that holds information about CFGBlock terminator ↵Marcin Swiderski1-1/+2
statement. llvm-svn: 117642
2010-09-16Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu1-5/+9
and discussions with Ted and Jordy. llvm-svn: 114056
2010-09-09Enhance -Wunreachable-code to not consider the 'default:' branch of a switch ↵Ted Kremenek1-5/+11
statement live if a switch on an enum value has explicit 'case:' statements for each enum value. llvm-svn: 113451
2010-08-25GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall1-1/+1
to the new constants. llvm-svn: 112047
2010-02-23Move the rest of the unreachable code analysis from libSemaTed Kremenek1-9/+235
to libAnalysis (with only the error reporting in libSema). llvm-svn: 96893
2010-02-23Start moving some of the logic for the unreachable code analysis out of libSemaTed Kremenek1-0/+52
and into libAnalysis. llvm-svn: 96872