summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Grasman <kim.grasman@gmail.com>2016-08-15 22:24:39 +0200
committerKim Grasman <kim.grasman@gmail.com>2016-08-15 22:24:39 +0200
commitdbceeb3c14c52a6a46776c361328dae04341d758 (patch)
treecef89239e9d10f6c37808999b51f522434405000
parent94949d09a007f6363b41a4e4344f488d9cd3585c (diff)
Fix inconsistent parameter names
Found by the clang-tidy check readability-inconsistent-declaration-parameter-name No functional change. Based on patch by Eugene Zelenko, thanks!
-rw-r--r--iwyu_globals.cc3
-rw-r--r--iwyu_globals.h3
-rw-r--r--iwyu_include_picker.cc26
-rw-r--r--iwyu_include_picker.h5
-rw-r--r--iwyu_lexer_utils.h8
-rw-r--r--iwyu_output.h2
6 files changed, 22 insertions, 25 deletions
diff --git a/iwyu_globals.cc b/iwyu_globals.cc
index 82719bb..f6f1232 100644
--- a/iwyu_globals.cc
+++ b/iwyu_globals.cc
@@ -315,8 +315,7 @@ static vector<HeaderSearchPath> ComputeHeaderSearchPaths(
return NormalizeHeaderSearchPaths(search_path_map);
}
-void InitGlobals(clang::SourceManager* sm,
- clang::HeaderSearch* header_search) {
+void InitGlobals(clang::SourceManager* sm, clang::HeaderSearch* header_search) {
CHECK_(sm && "InitGlobals() needs a non-nullptr SourceManager");
source_manager = sm;
data_getter = new SourceManagerCharacterDataGetter(*source_manager);
diff --git a/iwyu_globals.h b/iwyu_globals.h
index 0e4a229..8514439 100644
--- a/iwyu_globals.h
+++ b/iwyu_globals.h
@@ -59,8 +59,7 @@ class OptionsParser {
const char** clang_argv_;
};
-void InitGlobals(clang::SourceManager* source_manager,
- clang::HeaderSearch* header_search);
+void InitGlobals(clang::SourceManager* sm, clang::HeaderSearch* header_search);
// Can be called by tests -- doesn't need a SourceManager or
// argc/argv. Note that GlobalSourceManager() and DefaultDataGetter()
diff --git a/iwyu_include_picker.cc b/iwyu_include_picker.cc
index 13714b7..67c4193 100644
--- a/iwyu_include_picker.cc
+++ b/iwyu_include_picker.cc
@@ -976,20 +976,18 @@ void IncludePicker::AddDefaultMappings() {
IWYU_ARRAYSIZE(stdlib_cpp_public_headers));
}
-void IncludePicker::MarkVisibility(
- const string& quoted_filepath_pattern,
- IncludeVisibility vis) {
+void IncludePicker::MarkVisibility(const string& quoted_filepath_pattern,
+ IncludeVisibility visibility) {
CHECK_(!has_called_finalize_added_include_lines_ && "Can't mutate anymore");
// insert() leaves any old value alone, and only inserts if the key is new.
- filepath_visibility_map_.insert(make_pair(quoted_filepath_pattern, vis));
- CHECK_(filepath_visibility_map_[quoted_filepath_pattern] == vis)
+ filepath_visibility_map_.insert(
+ make_pair(quoted_filepath_pattern, visibility));
+ CHECK_(filepath_visibility_map_[quoted_filepath_pattern] == visibility)
<< " Same file seen with two different visibilities: "
<< quoted_filepath_pattern
- << " Old vis: "
- << filepath_visibility_map_[quoted_filepath_pattern]
- << " New vis: "
- << vis;
+ << " Old vis: " << filepath_visibility_map_[quoted_filepath_pattern]
+ << " New vis: " << visibility;
}
// AddDirectInclude lets us use some hard-coded rules to add filepath
@@ -999,7 +997,7 @@ void IncludePicker::MarkVisibility(
// hides them in /bits/.)
void IncludePicker::AddDirectInclude(const string& includer_filepath,
const string& includee_filepath,
- const string& quoted_include_as_typed) {
+ const string& quoted_include_as_written) {
CHECK_(!has_called_finalize_added_include_lines_ && "Can't mutate anymore");
// Note: the includer may be a .cc file, which is unnecessary to add
@@ -1009,7 +1007,7 @@ void IncludePicker::AddDirectInclude(const string& includer_filepath,
quoted_includes_to_quoted_includers_[quoted_includee].insert(quoted_includer);
const pair<string, string> key(includer_filepath, includee_filepath);
- includer_and_includee_to_include_as_typed_[key] = quoted_include_as_typed;
+ includer_and_includee_to_include_as_typed_[key] = quoted_include_as_written;
// Mark the clang fake-file "<built-in>" as private, so we never try
// to map anything to it.
@@ -1102,9 +1100,9 @@ void IncludePicker::MarkIncludeAsPrivate(
MarkVisibility(quoted_filepath_pattern, kPrivate);
}
-void IncludePicker::AddFriendRegex(const string& includee,
- const string& friend_regex) {
- friend_to_headers_map_["@" + friend_regex].insert(includee);
+void IncludePicker::AddFriendRegex(const string& includee_filepath,
+ const string& quoted_friend_regex) {
+ friend_to_headers_map_["@" + quoted_friend_regex].insert(includee_filepath);
}
namespace {
diff --git a/iwyu_include_picker.h b/iwyu_include_picker.h
index d7caf54..145db90 100644
--- a/iwyu_include_picker.h
+++ b/iwyu_include_picker.h
@@ -186,11 +186,12 @@ class IncludePicker {
void AddImplicitThirdPartyMappings();
// Adds an entry to filepath_visibility_map_, with error checking.
- void MarkVisibility(const string& quoted_include, IncludeVisibility vis);
+ void MarkVisibility(const string& quoted_filepath_pattern,
+ IncludeVisibility visibility);
// Parse visibility from a string. Returns kUnusedVisibility if
// string is not recognized.
- IncludeVisibility ParseVisibility(const string& visibility_str) const;
+ IncludeVisibility ParseVisibility(const string& visibility) const;
// Return the visibility of a given quoted_include if known, else
// kUnusedVisibility.
diff --git a/iwyu_lexer_utils.h b/iwyu_lexer_utils.h
index bde4ee6..821d96c 100644
--- a/iwyu_lexer_utils.h
+++ b/iwyu_lexer_utils.h
@@ -51,7 +51,7 @@ class SourceManagerCharacterDataGetter : public CharacterDataGetterInterface {
// Returns the source-code line from the current location until \n.
string GetSourceTextUntilEndOfLine(
clang::SourceLocation start_loc,
- const CharacterDataGetterInterface& character_data_getter);
+ const CharacterDataGetterInterface& data_getter);
// Returns the location right *after* the first occurrence of needle
// after start_loc, if any. (If none, returns an invalid source-loc.)
@@ -67,18 +67,18 @@ clang::SourceLocation GetLocationAfter(
// If include_loc points to the second INC, we'll return '<stdio.h>'.
string GetIncludeNameAsTyped(
clang::SourceLocation include_loc,
- const CharacterDataGetterInterface& character_data_getter);
+ const CharacterDataGetterInterface& data_getter);
// Given the range of an #if or #elif statement, determine the
// symbols which are arguments to "defined". This allows iwyu to
// treat these symbols as if #ifdef was used instead.
vector<clang::Token> FindArgumentsToDefined(
clang::SourceRange range,
- const CharacterDataGetterInterface& character_data_getter);
+ const CharacterDataGetterInterface& data_getter);
// Get the text of a given token.
string GetTokenText(const clang::Token& token,
- const CharacterDataGetterInterface& character_data_getter);
+ const CharacterDataGetterInterface& data_getter);
} // namespace include_what_you_use
diff --git a/iwyu_output.h b/iwyu_output.h
index d6fc04e..309d1f4 100644
--- a/iwyu_output.h
+++ b/iwyu_output.h
@@ -215,7 +215,7 @@ class IwyuFileInfo {
const string& quoted_includee, int linenumber);
// definitely_keep_fwd_decl tells us that we should never suggest
// the fwd-decl be removed, even if we don't see any uses of it.
- void AddForwardDeclare(const clang::NamedDecl* forward_declare_decl,
+ void AddForwardDeclare(const clang::NamedDecl* fwd_decl,
bool definitely_keep_fwd_decl);
void AddUsingDecl(const clang::UsingDecl* using_decl);