diff --git a/gen/cl_helpers.cpp b/gen/cl_helpers.cpp index 41ce6a19e5..0c1a363039 100644 --- a/gen/cl_helpers.cpp +++ b/gen/cl_helpers.cpp @@ -18,6 +18,7 @@ namespace opts { +#if LDC_LLVM_VER < 307 bool FlagParser::parse(cl::Option &O, llvm::StringRef ArgName, llvm::StringRef Arg, bool &Val) { // Make a std::string out of it to make comparisons easier // (and avoid repeated conversion) @@ -48,7 +49,7 @@ void FlagParser::getExtraOptionNames(llvm::SmallVectorImpl &Names) Names.push_back(I->first.data()); } } - +#endif MultiSetter::MultiSetter(bool invert, bool* p, ...) { this->invert = invert; diff --git a/gen/cl_helpers.h b/gen/cl_helpers.h index f89a42d9f5..c1ed6d651f 100644 --- a/gen/cl_helpers.h +++ b/gen/cl_helpers.h @@ -28,6 +28,9 @@ typedef Array Strings; namespace opts { namespace cl = llvm::cl; +#if LDC_LLVM_VER >= 307 +typedef cl::parser FlagParser; +#else /// Helper class for fancier options class FlagParser : public cl::parser { #if LDC_LLVM_VER >= 307 @@ -64,6 +67,7 @@ namespace opts { void getExtraOptionNames(llvm::SmallVectorImpl &Names); }; +#endif /// Helper class for options that set multiple flags class MultiSetter {