[cfe-commits] r63084 - in /cfe/trunk: include/clang/Analysis/PathDiagnostic.h lib/Analysis/BugReporter.cpp lib/Driver/HTMLDiagnostics.cpp utils/scan-build
Ted Kremenek
kremenek at apple.com
Mon Jan 26 17:53:39 PST 2009
Author: kremenek
Date: Mon Jan 26 19:53:39 2009
New Revision: 63084
URL: http://llvm.org/viewvc/llvm-project?rev=63084&view=rev
Log:
PathDiagnostics:
- Add the distinction between the 'bug type' and the 'bug description'
HTMLDiagnostics:
- Output the bug type field as HTML comments
scan-build:
- Use the bug type field instead of the bug description for the HTML table.
- Radar filing now automatically picks up the bug description in the title (addresses <rdar://problem/6265970>)
Modified:
cfe/trunk/include/clang/Analysis/PathDiagnostic.h
cfe/trunk/lib/Analysis/BugReporter.cpp
cfe/trunk/lib/Driver/HTMLDiagnostics.cpp
cfe/trunk/utils/scan-build
Modified: cfe/trunk/include/clang/Analysis/PathDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathDiagnostic.h?rev=63084&r1=63083&r2=63084&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathDiagnostic.h (original)
+++ cfe/trunk/include/clang/Analysis/PathDiagnostic.h Mon Jan 26 19:53:39 2009
@@ -78,20 +78,23 @@
unsigned Size;
std::string Desc;
std::string Category;
+ std::string BugType;
std::vector<std::string> OtherDesc;
public:
PathDiagnostic() : Size(0) {}
- PathDiagnostic(const char* desc, const char* category)
- : Size(0), Desc(desc), Category(category) {}
+ PathDiagnostic(const char* bugtype, const char* desc, const char* category)
+ : Size(0), Desc(desc), Category(category), BugType(bugtype) {}
- PathDiagnostic(const std::string& desc, const std::string& category)
- : Size(0), Desc(desc), Category(category) {}
+ PathDiagnostic(const std::string& bugtype, const std::string& desc,
+ const std::string& category)
+ : Size(0), Desc(desc), Category(category), BugType(bugtype) {}
~PathDiagnostic();
const std::string& getDescription() const { return Desc; }
+ const std::string& getBugType() const { return BugType; }
const std::string& getCategory() const { return Category; }
typedef std::vector<std::string>::const_iterator meta_iterator;
Modified: cfe/trunk/lib/Analysis/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BugReporter.cpp?rev=63084&r1=63083&r2=63084&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/BugReporter.cpp (original)
+++ cfe/trunk/lib/Analysis/BugReporter.cpp Mon Jan 26 19:53:39 2009
@@ -727,6 +727,7 @@
return;
llvm::OwningPtr<PathDiagnostic> D(new PathDiagnostic(R.getName(),
+ R.getDescription(),
R.getCategory()));
GeneratePathDiagnostic(*D.get(), R);
Modified: cfe/trunk/lib/Driver/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/HTMLDiagnostics.cpp?rev=63084&r1=63083&r2=63084&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/Driver/HTMLDiagnostics.cpp Mon Jan 26 19:53:39 2009
@@ -246,6 +246,14 @@
R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
}
+ const std::string& BugType = D.getBugType();
+ if (!BugType.empty()) {
+ std::string s;
+ llvm::raw_string_ostream os(s);
+ os << "\n<!-- BUGTYPE " << BugType << " -->\n";
+ R.InsertStrBefore(SMgr.getLocForStartOfFile(FID), os.str());
+ }
+
const std::string& BugCategory = D.getCategory();
if (!BugCategory.empty()) {
Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=63084&r1=63083&r2=63084&view=diff
==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Mon Jan 26 19:53:39 2009
@@ -350,7 +350,7 @@
# Scan the report file for tags.
open(IN, "$Dir/$FName") or DieDiag("Cannot open '$Dir/$FName'\n");
- my $BugDesc = "";
+ my $BugType = "";
my $BugFile = "";
my $BugCategory;
my $BugPathLength = 1;
@@ -361,8 +361,8 @@
last if ($found == 5);
- if (/<!-- BUGDESC (.*) -->$/) {
- $BugDesc = $1;
+ if (/<!-- BUGTYPE (.*) -->$/) {
+ $BugType = $1;
++$found;
}
elsif (/<!-- BUGFILE (.*) -->$/) {
@@ -390,7 +390,7 @@
$BugCategory = "Other";
}
- push @$Index,[ $FName, $BugCategory, $BugDesc, $BugFile, $BugLine,
+ push @$Index,[ $FName, $BugCategory, $BugType, $BugFile, $BugLine,
$BugPathLength ];
}
More information about the cfe-commits
mailing list