llvm-project/clang/lib/Analysis
Chris Lattner 8488c8297c This reworks some of the Diagnostic interfaces a bit to change how diagnostics
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
2008-11-18 07:04:44 +00:00
..
BasicConstraintManager.cpp Print integer value instead of raw pointer. This is a hack to be fixed by migrating the output in analyzer to llvm::raw_ostream. 2008-11-10 05:00:06 +00:00
BasicObjCFoundationChecks.cpp Added method "getSelfRegion" to Store. This method returns the region associated with the "this" or "self" object (C++ and Objective-C respectively). 2008-10-24 20:32:16 +00:00
BasicObjCFoundationChecks.h Change implementation of NSError** coding-style check to be invoked at the end of the retain/release analysis. 2008-09-18 21:25:13 +00:00
BasicStore.cpp Enhance modularization: return a <state,loc> pair to let GRExprEngine modify the 2008-11-16 07:06:26 +00:00
BasicValueFactory.cpp CompoundVal now uses an ImmutableList<SVal> to store its set of SVals. This change was motivated by the need to allow state-splitting in GRExprEngine::VisitInitListExpr. As a side-benefit, we no longer need to perform any copies of SVals when creating a CompoundSVal, and the profiling of CompoundSVal is now constant time. 2008-10-30 17:44:46 +00:00
BugReporter.cpp This reworks some of the Diagnostic interfaces a bit to change how diagnostics 2008-11-18 07:04:44 +00:00
CFRefCount.cpp GRExprEngine/CFRefCount/GRSimpleVals: We don't do any special handling (yet) of vector types. Add explicit checks that when we process integers that they really are scalars. 2008-11-13 06:10:40 +00:00
CMakeLists.txt CMake: Builds and installs clang binary and libs (no docs yet). It 2008-10-26 00:56:18 +00:00
CheckDeadStores.cpp Enhance dead store checker to not flag preincrements to dead variables where the preincrement is a subexpression, e.g. foo(++x); This can cause false negatives, but will remove a whole class of false positives. 2008-10-15 05:23:41 +00:00
CheckNSError.cpp - constify some uses of MemRegion* (MemRegion should be immutable). 2008-10-17 20:28:54 +00:00
CheckObjCDealloc.cpp Add a new expression class, ObjCSuperExpr, to handle the Objective-C 'super'. Remove ObjCThis from PredefinedExpr 2008-11-04 14:56:14 +00:00
CheckObjCInstMethSignature.cpp Added method "EmitBasicReport" to BugReporter to simplify the emission of simple bug diagnostics. 2008-07-14 17:40:50 +00:00
CheckObjCUnusedIVars.cpp The "unused ivar" check now has a category: "Optimization" 2008-09-21 18:58:22 +00:00
Environment.cpp GRStateRef: 2008-11-12 19:21:30 +00:00
ExplodedGraph.cpp Added "Auditor" interface for auditing the construction of ExplodedGraphs. 2008-08-27 01:56:11 +00:00
GRBlockCounter.cpp Updated clients of ImmutableMap::SlimFind to use ImmutableMap::lookup instead. 2008-07-07 16:21:19 +00:00
GRCoreEngine.cpp Add (preliminary) transfer function support for ObjCForCollectionStmt. Still need to flesh out some logic. 2008-11-12 19:24:17 +00:00
GRExprEngine.cpp Enhance modularization: return a <state,loc> pair to let GRExprEngine modify the 2008-11-16 07:06:26 +00:00
GRExprEngineInternalChecks.cpp Enhance return-of-stack-address checker to recognize regions created by alloca(). 2008-11-02 00:35:25 +00:00
GRSimpleVals.cpp Implement FIXME in GRExprEngine::VisitUnaryOperator() to handle implicit conversions caused by the '!' operator. This required adding some logic to GRSimpleVals to reason about nonloc::LocAsInteger SVals. This code appears to work fine, but it should eventually be cleaned up. 2008-11-15 00:20:05 +00:00
GRSimpleVals.h Implement FIXME in GRExprEngine::VisitUnaryOperator() to handle implicit conversions caused by the '!' operator. This required adding some logic to GRSimpleVals to reason about nonloc::LocAsInteger SVals. This code appears to work fine, but it should eventually be cleaned up. 2008-11-15 00:20:05 +00:00
GRState.cpp GRStateRef: 2008-11-12 19:21:30 +00:00
GRTransferFuncs.cpp Implement FIXME in GRExprEngine::VisitUnaryOperator() to handle implicit conversions caused by the '!' operator. This required adding some logic to GRSimpleVals to reason about nonloc::LocAsInteger SVals. This code appears to work fine, but it should eventually be cleaned up. 2008-11-15 00:20:05 +00:00
LiveVariables.cpp Minor tweaks to liveness analysis: 2008-11-14 21:07:14 +00:00
Makefile Make a major restructuring of the clang tree: introduce a top-level 2008-03-15 23:59:48 +00:00
MemRegion.cpp Fold assertion into second valid else branch. This removes a compiler warning 2008-11-17 22:55:12 +00:00
NOTES.TXT Add some notes for SCA. 2008-11-03 06:04:23 +00:00
PathDiagnostic.cpp This reworks some of the Diagnostic interfaces a bit to change how diagnostics 2008-11-18 07:04:44 +00:00
RegionStore.cpp Enhance modularization: return a <state,loc> pair to let GRExprEngine modify the 2008-11-16 07:06:26 +00:00
SVals.cpp Flush llvm::errs() when printing out SVals. 2008-11-15 00:16:53 +00:00
SymbolManager.cpp Conjured symbols now bind to Stmt* instead of Expr*. 2008-11-12 19:22:47 +00:00
UninitializedValues.cpp Flow-sensitive uninitialized values analysis: properly handle the 'element' expression of ObjCForCollectionStmt (can be anything). 2008-11-14 18:21:25 +00:00