versioner: replace availability attributes with annotate.
Major refactor to use __attribute__((annotate)) to be able to keep
track of the semantic differences between __INTRODUCED_IN(x) and
__INTRODUCED_IN_X86(x), for use in the upcoming preprocessor.
Bug: http://b/30170081
Change-Id: I6496a8c40ba7f4553de9a2be0bbddcf37c813937
diff --git a/tools/versioner/src/Utils.h b/tools/versioner/src/Utils.h
index f4845b8..c79c97e 100644
--- a/tools/versioner/src/Utils.h
+++ b/tools/versioner/src/Utils.h
@@ -19,10 +19,11 @@
#include <string>
#include <vector>
+#include <llvm/ADT/StringRef.h>
+
std::string getWorkingDir();
std::vector<std::string> collectFiles(const std::string& directory);
-namespace std {
static __attribute__((unused)) std::string to_string(const char* c) {
return c;
}
@@ -30,13 +31,13 @@
static __attribute__((unused)) const std::string& to_string(const std::string& str) {
return str;
}
-}
template <typename Collection>
static std::string Join(Collection c, const std::string& delimiter = ", ") {
std::string result;
for (const auto& item : c) {
- result.append(std::to_string(item));
+ using std::to_string;
+ result.append(to_string(item));
result.append(delimiter);
}
if (!result.empty()) {
@@ -44,3 +45,5 @@
}
return result;
}
+
+llvm::StringRef StripPrefix(llvm::StringRef string, llvm::StringRef prefix);