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

Side by Side Diff: tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp

Issue 2578103003: Add use-chromium-style-naming option to Blink GC plugin. (Closed)
Patch Set: Rebase Created 4 years 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "BlinkGCPluginConsumer.h" 5 #include "BlinkGCPluginConsumer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "CheckDispatchVisitor.h" 10 #include "CheckDispatchVisitor.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 : instance_(instance), 68 : instance_(instance),
69 reporter_(instance), 69 reporter_(instance),
70 options_(options), 70 options_(options),
71 cache_(instance), 71 cache_(instance),
72 json_(0) { 72 json_(0) {
73 // Only check structures in the blink and WebKit namespaces. 73 // Only check structures in the blink and WebKit namespaces.
74 options_.checked_namespaces.insert("blink"); 74 options_.checked_namespaces.insert("blink");
75 75
76 // Ignore GC implementation files. 76 // Ignore GC implementation files.
77 options_.ignored_directories.push_back("/heap/"); 77 options_.ignored_directories.push_back("/heap/");
78
79 if (!options_.use_chromium_style_naming)
80 Config::UseLegacyNames();
78 } 81 }
79 82
80 void BlinkGCPluginConsumer::HandleTranslationUnit(ASTContext& context) { 83 void BlinkGCPluginConsumer::HandleTranslationUnit(ASTContext& context) {
81 // Don't run the plugin if the compilation unit is already invalid. 84 // Don't run the plugin if the compilation unit is already invalid.
82 if (reporter_.hasErrorOccurred()) 85 if (reporter_.hasErrorOccurred())
83 return; 86 return;
84 87
85 ParseFunctionTemplates(context.getTranslationUnitDecl()); 88 ParseFunctionTemplates(context.getTranslationUnitDecl());
86 89
87 CollectVisitor visitor; 90 CollectVisitor visitor;
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 SourceLocation spelling_location = source_manager.getSpellingLoc(loc); 722 SourceLocation spelling_location = source_manager.getSpellingLoc(loc);
720 PresumedLoc ploc = source_manager.getPresumedLoc(spelling_location); 723 PresumedLoc ploc = source_manager.getPresumedLoc(spelling_location);
721 if (ploc.isInvalid()) { 724 if (ploc.isInvalid()) {
722 // If we're in an invalid location, we're looking at things that aren't 725 // If we're in an invalid location, we're looking at things that aren't
723 // actually stated in the source. 726 // actually stated in the source.
724 return false; 727 return false;
725 } 728 }
726 *filename = ploc.getFilename(); 729 *filename = ploc.getFilename();
727 return true; 730 return true;
728 } 731 }
OLDNEW
« no previous file with comments | « tools/clang/blink_gc_plugin/BlinkGCPlugin.cpp ('k') | tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698