summaryrefslogtreecommitdiff
path: root/tools/versioner/src/Preprocessor.cpp
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2020-05-01 18:35:15 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-05-01 18:35:15 +0000
commitca1a1826327b65e1dba900224f716a72ec88c6eb (patch)
treed2538874263d78679841b89181c6525cd8d36e04 /tools/versioner/src/Preprocessor.cpp
parent442b8eaa4ac85604fbb25fa0b1ee699cf73e7701 (diff)
parentbf7ab25e983b76135fafde6b410818504e296827 (diff)
Merge "Adapt to clang-r383902" am: ac47b2b56e am: bf7ab25e98
Change-Id: I65913e91a5129c86cbe2182803ae1133e4ef2a8b
Diffstat (limited to 'tools/versioner/src/Preprocessor.cpp')
-rw-r--r--tools/versioner/src/Preprocessor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/versioner/src/Preprocessor.cpp b/tools/versioner/src/Preprocessor.cpp
index 4ee3446f1..7a5b502db 100644
--- a/tools/versioner/src/Preprocessor.cpp
+++ b/tools/versioner/src/Preprocessor.cpp
@@ -446,7 +446,7 @@ bool preprocessHeaders(const std::string& dst_dir, const std::string& src_dir,
continue;
}
- std::string rel_path = path.substr(src_dir.length() + 1);
+ std::string rel_path = path.substr(src_dir.length() + 1).str();
std::string dst_path = dst_dir + "/" + rel_path;
llvm::StringRef parent_path = llvm::sys::path::parent_path(dst_path);
if (llvm::sys::fs::create_directories(parent_path)) {
@@ -471,13 +471,13 @@ bool preprocessHeaders(const std::string& dst_dir, const std::string& src_dir,
GuardMap guard_map;
for (const auto& it : orig_guard_map) {
Location loc = it.first;
- loc.end = findNextSemicolon(file_lines[file_path], loc.end);
+ loc.end = findNextSemicolon(file_lines[file_path.str()], loc.end);
guard_map[loc] = it.second;
}
// TODO: Make sure that the Locations don't overlap.
// TODO: Merge adjacent non-identical guards.
- mergeGuards(file_lines[file_path], guard_map);
+ mergeGuards(file_lines[file_path.str()], guard_map);
if (!file_path.startswith(src_dir)) {
errx(1, "input file %s is not in %s\n", file_path.str().c_str(), src_dir.c_str());
@@ -487,7 +487,7 @@ bool preprocessHeaders(const std::string& dst_dir, const std::string& src_dir,
llvm::StringRef rel_path = file_path.substr(src_dir.size(), file_path.size() - src_dir.size());
std::string output_path = (llvm::Twine(dst_dir) + rel_path).str();
- rewriteFile(output_path, file_lines[file_path], guard_map);
+ rewriteFile(output_path, file_lines[file_path.str()], guard_map);
}
return true;