mac: Prepare for -Wunused-functions.
Mostly involves deleting hundreds of lines of unused code.
BUG=315884
R=akalin@chromium.org, brettw@chromium.org, fischman@chromium.org, jamesr@chromium.org, sky@chromium.org, thestig@chromium.org
TBR=piman, youngki
Review URL: https://codereview.chromium.org/63153003
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4159e7f4840e961b69e4f9438a5858d0b3fe6e63
diff --git a/tools/gn/input_conversion.cc b/tools/gn/input_conversion.cc
index efdff1a..e64323a 100644
--- a/tools/gn/input_conversion.cc
+++ b/tools/gn/input_conversion.cc
@@ -19,34 +19,6 @@
namespace {
-// Returns the "first bit" of some script output for writing to error messages.
-std::string GetExampleOfBadInput(const std::string& input) {
- std::string result(input);
-
- // Maybe the result starts with a blank line or something, which we don't
- // want.
- TrimWhitespaceASCII(result, TRIM_ALL, &result);
-
- // Now take the first line, or the first set of chars, whichever is shorter.
- bool trimmed = false;
- size_t newline_offset = result.find('\n');
- if (newline_offset != std::string::npos) {
- trimmed = true;
- result.resize(newline_offset);
- }
- TrimWhitespaceASCII(result, TRIM_ALL, &result);
-
- const size_t kMaxSize = 50;
- if (result.size() > kMaxSize) {
- trimmed = true;
- result.resize(kMaxSize);
- }
-
- if (trimmed)
- result.append("...");
- return result;
-}
-
// When parsing the result as a value, we may get various types of errors.
// This creates an error message for this case with an optional nested error
// message to reference. If there is no nested err, pass Err().
diff --git a/tools/gn/parser.cc b/tools/gn/parser.cc
index 649d4cf..6392eed 100644
--- a/tools/gn/parser.cc
+++ b/tools/gn/parser.cc
@@ -18,17 +18,6 @@
// else := 'else' (if | statement)*
// assignment := ident {'=' | '+=' | '-='} expr
-namespace {
-
-// Returns true if the two tokens are on the same line. We assume they're in
-// the same file.
-bool IsSameLine(const Token& a, const Token& b) {
- DCHECK(a.location().file() == b.location().file());
- return a.location().line_number() == b.location().line_number();
-}
-
-} // namespace
-
enum Precedence {
PRECEDENCE_ASSIGNMENT = 1,
PRECEDENCE_OR = 2,
diff --git a/tools/gn/setup.cc b/tools/gn/setup.cc
index 47a243a..ae02bf1 100644
--- a/tools/gn/setup.cc
+++ b/tools/gn/setup.cc
@@ -99,6 +99,7 @@
return FindDotFile(up_one_dir);
}
+#if defined(OS_WIN)
// Searches the list of strings, and returns the FilePat corresponding to the
// one ending in the given substring, or the empty path if none match.
base::FilePath GetPathEndingIn(
@@ -111,13 +112,12 @@
return base::FilePath();
}
-// Fins the depot tools directory in the path environment variable and returns
+// Finds the depot tools directory in the path environment variable and returns
// its value. Returns an empty file path if not found.
//
// We detect the depot_tools path by looking for a directory with depot_tools
// at the end (optionally followed by a separator).
base::FilePath ExtractDepotToolsFromPath() {
-#if defined(OS_WIN)
static const wchar_t kPathVarName[] = L"Path";
DWORD env_buf_size = GetEnvironmentVariable(kPathVarName, NULL, 0);
if (env_buf_size == 0)
@@ -132,17 +132,6 @@
base::SplitString(path, ';', &components);
base::string16 ending_in1 = L"depot_tools\\";
-#else
- static const char kPathVarName[] = "PATH";
- const char* path = getenv(kPathVarName);
- if (!path)
- return base::FilePath();
-
- std::vector<std::string> components;
- base::SplitString(path, ':', &components);
-
- std::string ending_in1 = "depot_tools/";
-#endif
base::FilePath::StringType ending_in2 = FILE_PATH_LITERAL("depot_tools");
base::FilePath found = GetPathEndingIn(components, ending_in1);
@@ -150,6 +139,7 @@
return found;
return GetPathEndingIn(components, ending_in2);
}
+#endif
} // namespace