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

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

Issue 1117163002: Clang style plugin: add warn-only option and use it on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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 #include "FindBadConstructsAction.h" 5 #include "FindBadConstructsAction.h"
6 6
7 #include "clang/AST/ASTConsumer.h" 7 #include "clang/AST/ASTConsumer.h"
8 #include "clang/Frontend/FrontendPluginRegistry.h" 8 #include "clang/Frontend/FrontendPluginRegistry.h"
9 9
10 #include "FindBadConstructsConsumer.h" 10 #include "FindBadConstructsConsumer.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // TODO(rsleevi): Remove this once http://crbug.com/123295 is fixed. 50 // TODO(rsleevi): Remove this once http://crbug.com/123295 is fixed.
51 options_.check_base_classes = true; 51 options_.check_base_classes = true;
52 } else if (args[i] == "check-enum-last-value") { 52 } else if (args[i] == "check-enum-last-value") {
53 // TODO(tsepez): Enable this by default once http://crbug.com/356815 53 // TODO(tsepez): Enable this by default once http://crbug.com/356815
54 // and http://crbug.com/356816 are fixed. 54 // and http://crbug.com/356816 are fixed.
55 options_.check_enum_last_value = true; 55 options_.check_enum_last_value = true;
56 } else if (args[i] == "with-ast-visitor") { 56 } else if (args[i] == "with-ast-visitor") {
57 options_.with_ast_visitor = true; 57 options_.with_ast_visitor = true;
58 } else if (args[i] == "check-templates") { 58 } else if (args[i] == "check-templates") {
59 options_.check_templates = true; 59 options_.check_templates = true;
60 } else if (args[i] == "warn-only") {
61 options_.warn_only = true;
Nico 2015/04/30 23:08:04 I'd make this block windows-only
hans 2015/04/30 23:13:32 that's ok) I like that test. It found the bug whe
60 } else { 62 } else {
61 parsed = false; 63 parsed = false;
62 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n"; 64 llvm::errs() << "Unknown clang plugin argument: " << args[i] << "\n";
63 } 65 }
64 } 66 }
65 67
66 return parsed; 68 return parsed;
67 } 69 }
68 70
69 } // namespace chrome_checker 71 } // namespace chrome_checker
70 72
71 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X( 73 static FrontendPluginRegistry::Add<chrome_checker::FindBadConstructsAction> X(
72 "find-bad-constructs", 74 "find-bad-constructs",
73 "Finds bad C++ constructs"); 75 "Finds bad C++ constructs");
OLDNEW
« no previous file with comments | « tools/clang/plugins/ChromeClassTester.cpp ('k') | tools/clang/plugins/FindBadConstructsConsumer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698