aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-30 23:47:44 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-30 23:47:44 +0000
commit072192bcbb05a0fee7ec3061750b27e8d2004952 (patch)
tree37048b412bd73992a50738e0b948108bf453bba5 /include/clang
parent6b6289848e215ff12d4d54fe0602d3371db52788 (diff)
added preliminary diagnostics in scan-build results to denote whether
a CF memory leak occurred with GC enabled, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Analysis/LocalCheckers.h6
-rw-r--r--include/clang/Analysis/PathDiagnostic.h8
-rw-r--r--include/clang/Analysis/PathSensitive/BugReporter.h8
3 files changed, 20 insertions, 2 deletions
diff --git a/include/clang/Analysis/LocalCheckers.h b/include/clang/Analysis/LocalCheckers.h
index bf4f30a337..64dc4dd90f 100644
--- a/include/clang/Analysis/LocalCheckers.h
+++ b/include/clang/Analysis/LocalCheckers.h
@@ -24,14 +24,16 @@ class ASTContext;
class PathDiagnosticClient;
class GRTransferFuncs;
class BugType;
-
+class LangOptions;
+
void CheckDeadStores(CFG& cfg, ASTContext &Ctx, Diagnostic &Diags);
void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
bool FullUninitTaint=false);
GRTransferFuncs* MakeGRSimpleValsTF();
-GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled);
+GRTransferFuncs* MakeCFRefCountTF(ASTContext& Ctx, bool GCEnabled,
+ const LangOptions& lopts);
BugType* MakeDeadStoresChecker();
} // end namespace clang
diff --git a/include/clang/Analysis/PathDiagnostic.h b/include/clang/Analysis/PathDiagnostic.h
index f9bd0fd106..77234e7c4a 100644
--- a/include/clang/Analysis/PathDiagnostic.h
+++ b/include/clang/Analysis/PathDiagnostic.h
@@ -65,6 +65,7 @@ class PathDiagnostic {
std::list<PathDiagnosticPiece*> path;
unsigned Size;
std::string Desc;
+ std::vector<std::string> OtherDesc;
public:
PathDiagnostic() : Size(0) {}
@@ -75,6 +76,13 @@ public:
const std::string& getDescription() const { return Desc; }
+ typedef std::vector<std::string>::const_iterator meta_iterator;
+ meta_iterator meta_begin() const { return OtherDesc.begin(); }
+ meta_iterator meta_end() const { return OtherDesc.end(); }
+ void addMeta(const std::string& s) { OtherDesc.push_back(s); }
+ void addMeta(const char* s) { OtherDesc.push_back(s); }
+
+
void push_front(PathDiagnosticPiece* piece) {
path.push_front(piece);
++Size;
diff --git a/include/clang/Analysis/PathSensitive/BugReporter.h b/include/clang/Analysis/PathSensitive/BugReporter.h
index 325e1a750f..5a8606f071 100644
--- a/include/clang/Analysis/PathSensitive/BugReporter.h
+++ b/include/clang/Analysis/PathSensitive/BugReporter.h
@@ -41,6 +41,10 @@ public:
virtual const char* getName() const = 0;
virtual const char* getDescription() const { return getName(); }
+
+ virtual std::pair<const char**,const char**> getExtraDescriptiveText() {
+ return std::pair<const char**, const char**>(0, 0);
+ }
virtual void EmitWarnings(BugReporter& BR) {}
virtual void GetErrorNodes(std::vector<ExplodedNode<ValueState>*>& Nodes) {}
@@ -78,6 +82,10 @@ public:
return getBugType().getDescription();
}
+ virtual std::pair<const char**,const char**> getExtraDescriptiveText() {
+ return getBugType().getExtraDescriptiveText();
+ }
+
virtual PathDiagnosticPiece* getEndPath(BugReporter& BR,
ExplodedNode<ValueState>* N) const;