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

Side by Side Diff: tools/clang/plugins/ChromeClassTester.cpp

Issue 195623002: roll clang 198389:202554 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/clang/blink_gc_plugin/Makefile ('k') | tools/clang/scripts/package.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // A general interface for filtering and only acting on classes in Chromium C++ 5 // A general interface for filtering and only acting on classes in Chromium C++
6 // code. 6 // code.
7 7
8 #include "ChromeClassTester.h" 8 #include "ChromeClassTester.h"
9 9
10 #include <sys/param.h> 10 #include <sys/param.h>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 CheckChromeEnum(enum_location, enum_decl); 103 CheckChromeEnum(enum_location, enum_decl);
104 } 104 }
105 } 105 }
106 106
107 void ChromeClassTester::emitWarning(SourceLocation loc, 107 void ChromeClassTester::emitWarning(SourceLocation loc,
108 const char* raw_error) { 108 const char* raw_error) {
109 FullSourceLoc full(loc, instance().getSourceManager()); 109 FullSourceLoc full(loc, instance().getSourceManager());
110 std::string err; 110 std::string err;
111 err = "[chromium-style] "; 111 err = "[chromium-style] ";
112 err += raw_error; 112 err += raw_error;
113 DiagnosticsEngine::Level level = 113 DiagnosticIDs::Level level =
114 diagnostic().getWarningsAsErrors() ? 114 diagnostic().getWarningsAsErrors() ?
115 DiagnosticsEngine::Error : 115 DiagnosticIDs::Error :
116 DiagnosticsEngine::Warning; 116 DiagnosticIDs::Warning;
117 unsigned id = diagnostic().getCustomDiagID(level, err); 117 unsigned id = diagnostic().getDiagnosticIDs()->getCustomDiagID(level, err);
118 DiagnosticBuilder builder = diagnostic().Report(full, id); 118 DiagnosticBuilder builder = diagnostic().Report(full, id);
119 } 119 }
120 120
121 bool ChromeClassTester::InBannedNamespace(const Decl* record) { 121 bool ChromeClassTester::InBannedNamespace(const Decl* record) {
122 std::string n = GetNamespace(record); 122 std::string n = GetNamespace(record);
123 if (!n.empty()) { 123 if (!n.empty()) {
124 return std::find(banned_namespaces_.begin(), banned_namespaces_.end(), n) 124 return std::find(banned_namespaces_.begin(), banned_namespaces_.end(), n)
125 != banned_namespaces_.end(); 125 != banned_namespaces_.end();
126 } 126 }
127 127
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 PresumedLoc ploc = source_manager.getPresumedLoc(spelling_location); 308 PresumedLoc ploc = source_manager.getPresumedLoc(spelling_location);
309 if (ploc.isInvalid()) { 309 if (ploc.isInvalid()) {
310 // If we're in an invalid location, we're looking at things that aren't 310 // If we're in an invalid location, we're looking at things that aren't
311 // actually stated in the source. 311 // actually stated in the source.
312 return false; 312 return false;
313 } 313 }
314 314
315 *filename = ploc.getFilename(); 315 *filename = ploc.getFilename();
316 return true; 316 return true;
317 } 317 }
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/Makefile ('k') | tools/clang/scripts/package.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698