Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: tools/clang/plugins/ChromeClassTester.cpp

Issue 1072203002: Build the Clang plugin on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Really rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/clang/plugins/CMakeLists.txt ('k') | tools/clang/plugins/FindBadConstructsConsumer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/plugins/ChromeClassTester.cpp
diff --git a/tools/clang/plugins/ChromeClassTester.cpp b/tools/clang/plugins/ChromeClassTester.cpp
index a08ead4bd5d39f6c885d0ec2f7648451d14464c5..e9a0bcac479cae3b7d87a100f87a1b5f9c812504 100644
--- a/tools/clang/plugins/ChromeClassTester.cpp
+++ b/tools/clang/plugins/ChromeClassTester.cpp
@@ -7,6 +7,8 @@
#include "ChromeClassTester.h"
+#include <algorithm>
+
#include "clang/AST/AST.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceManager.h"
@@ -232,6 +234,9 @@ std::string ChromeClassTester::GetNamespaceImpl(const DeclContext* context,
}
bool ChromeClassTester::InBannedDirectory(SourceLocation loc) {
+ if (instance().getSourceManager().isInSystemHeader(loc))
+ return true;
+
std::string filename;
if (!GetFilename(loc, &filename)) {
// If the filename cannot be determined, simply treat this as a banned
@@ -250,7 +255,7 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) {
return true;
}
-#ifdef LLVM_ON_UNIX
+#if defined(LLVM_ON_UNIX)
// We need to munge the paths so that they are relative to the repository
// srcroot. We first resolve the symlinktastic relative path and then
// remove our known srcroot from it if needed.
@@ -260,6 +265,10 @@ bool ChromeClassTester::InBannedDirectory(SourceLocation loc) {
}
#endif
+#if defined(LLVM_ON_WIN32)
+ std::replace(filename.begin(), filename.end(), '\\', '/');
+#endif
+
for (const std::string& banned_dir : banned_directories_) {
// If any of the banned directories occur as a component in filename,
// this file is rejected.
« no previous file with comments | « tools/clang/plugins/CMakeLists.txt ('k') | tools/clang/plugins/FindBadConstructsConsumer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698