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

Unified Diff: src/IceClFlags.cpp

Issue 2602713002: Subzero: Fix some build problems against LLVM trunk. (Closed)
Patch Set: Reformat Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceClFlags.def » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceClFlags.cpp
diff --git a/src/IceClFlags.cpp b/src/IceClFlags.cpp
index 516713c31308ed631c45304f9e8e5601d9ada1ba..5de8a5b46502482789fb12fe58e567ddfaf86f98 100644
--- a/src/IceClFlags.cpp
+++ b/src/IceClFlags.cpp
@@ -60,6 +60,14 @@ using llvm::cl::ParseCommandLineOptions;
using llvm::cl::Positional;
+// LLVM commit 3ffe113e11168abcd809ec5ac539538ade5db0cb changed the internals of
+// llvm::cl that need to be mirrored here. That commit removed the clEnumValEnd
+// macro, so we can use that to determine which version of LLVM we're compiling
+// against.
+#if defined(clEnumValEnd)
+
+#define CLENUMVALEND , clEnumValEnd
+
template <typename T> using ValuesClass = llvm::cl::ValuesClass<T>;
template <typename T, typename... A>
@@ -67,6 +75,18 @@ ValuesClass<T> values(const char *Arg, T Val, const char *Desc, A &&... Args) {
return llvm::cl::values(Arg, Val, Desc, std::forward<A>(Args)..., nullptr);
}
+#else // !defined(clEnumValEnd)
+
+#define CLENUMVALEND
+
+using llvm::cl::OptionEnumValue;
+
+template <typename... A> llvm::cl::ValuesClass values(A &&... Args) {
+ return llvm::cl::values(std::forward<A>(Args)...);
+}
+
+#endif // !defined(clEnumValEnd)
+
using llvm::cl::value_desc;
} // end of namespace cl
« no previous file with comments | « no previous file | src/IceClFlags.def » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698