]> granicus.if.org Git - clang/commitdiff
Temporarily revert r191910 until the layering violation can be fixed.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 3 Oct 2013 23:38:02 +0000 (23:38 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 3 Oct 2013 23:38:02 +0000 (23:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191936 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Checkers/CommonBugCategories.h
include/clang/StaticAnalyzer/Core/BugReporter/BugType.h
lib/StaticAnalyzer/Checkers/CStringChecker.cpp
lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp
lib/StaticAnalyzer/Checkers/CommonBugCategories.cpp

index be4ec5effbd330e64bf26680c6ab52965674aa5b..9d4251b1a757b46d16c868be81db9070fa2ed666 100644 (file)
@@ -15,7 +15,6 @@ namespace clang {
   namespace ento {
     namespace categories {
       extern const char *CoreFoundationObjectiveC;
-      extern const char *LogicError;
       extern const char *MemoryCoreFoundationObjectiveC;
       extern const char *UnixAPI;
     }
index 60397f5d47554c476e48a267bc694dd491530a39..644aa3159301dbee89cb122a08170686418c39d7 100644 (file)
@@ -15,7 +15,6 @@
 #define LLVM_CLANG_ANALYSIS_BUGTYPE
 
 #include "clang/Basic/LLVM.h"
-#include "clang/StaticAnalyzer/Checkers/CommonBugCategories.h"
 #include "llvm/ADT/FoldingSet.h"
 #include <string>
 
@@ -55,10 +54,10 @@ class BuiltinBug : public BugType {
   const std::string desc;
 public:
   BuiltinBug(const char *name, const char *description)
-    : BugType(name, categories::LogicError), desc(description) {}
+    : BugType(name, "Logic error"), desc(description) {}
   
   BuiltinBug(const char *name)
-    : BugType(name, categories::LogicError), desc(name) {}
+    : BugType(name, "Logic error"), desc(name) {}
   
   StringRef getDescription() const { return desc; }
 };
index e642c2974ea1153bd3f76321de8b63b374cafbc9..ba1d9b9ff6bd516fa4b4049d7e0b00a1fffc8ec7 100644 (file)
@@ -231,7 +231,7 @@ ProgramStateRef CStringChecker::checkNonNull(CheckerContext &C,
       return NULL;
 
     if (!BT_Null)
-      BT_Null.reset(new BuiltinBug(categories::UnixAPI,
+      BT_Null.reset(new BuiltinBug("Unix API",
         "Null pointer argument in call to byte string function"));
 
     SmallString<80> buf;
@@ -525,7 +525,7 @@ void CStringChecker::emitOverlapBug(CheckerContext &C, ProgramStateRef state,
     return;
 
   if (!BT_Overlap)
-    BT_Overlap.reset(new BugType(categories::UnixAPI, "Improper arguments"));
+    BT_Overlap.reset(new BugType("Unix API", "Improper arguments"));
 
   // Generate a report for this bug.
   BugReport *report = 
@@ -702,7 +702,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state,
 
       if (ExplodedNode *N = C.addTransition(state)) {
         if (!BT_NotCString)
-          BT_NotCString.reset(new BuiltinBug(categories::UnixAPI,
+          BT_NotCString.reset(new BuiltinBug("Unix API",
             "Argument is not a null-terminated string."));
 
         SmallString<120> buf;
@@ -762,7 +762,7 @@ SVal CStringChecker::getCStringLength(CheckerContext &C, ProgramStateRef &state,
 
     if (ExplodedNode *N = C.addTransition(state)) {
       if (!BT_NotCString)
-        BT_NotCString.reset(new BuiltinBug(categories::UnixAPI,
+        BT_NotCString.reset(new BuiltinBug("Unix API",
           "Argument is not a null-terminated string."));
 
       SmallString<120> buf;
index 3eeb948798e32081d53c77f6b39c2f5cf75335cf..f2c50501a65c8aec4c5746e5f23b5ba31240862e 100644 (file)
@@ -65,7 +65,7 @@ void WalkAST::VisitUnaryExprOrTypeTraitExpr(UnaryExprOrTypeTraitExpr *E) {
       PathDiagnosticLocation::createBegin(E, BR.getSourceManager(), AC);
     BR.EmitBasicReport(AC->getDecl(),
                        "Potential unintended use of sizeof() on pointer type",
-                       categories::LogicError,
+                       "Logic",
                        "The code calls sizeof() on a pointer type. "
                        "This can produce an unexpected result.",
                        ELoc, &R, 1);
index c53e98f631202fa6c4d287dffe9ea998b94e8a0b..e2a8ea616611cedbddd8ab85020f64a1d6a26286 100644 (file)
@@ -11,7 +11,6 @@
 namespace clang { namespace ento { namespace categories {
 
 const char *CoreFoundationObjectiveC = "Core Foundation/Objective-C";
-const char *LogicError = "Logic error";
 const char *MemoryCoreFoundationObjectiveC =
   "Memory (Core Foundation/Objective-C)";
 const char *UnixAPI = "Unix API";