diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp index 66fbe68af653..3ed4dc7e9322 100644 --- a/mlir/lib/Pass/PassRegistry.cpp +++ b/mlir/lib/Pass/PassRegistry.cpp @@ -419,40 +419,38 @@ size_t detail::PassOptions::getOptionWidth() const { // OpPassManager: OptionValue //===----------------------------------------------------------------------===// -llvm::cl::OptionValue::OptionValue() = default; -llvm::cl::OptionValue::OptionValue( - const mlir::OpPassManager &value) { +namespace llvm::cl { + +OptionValue::OptionValue() = default; +OptionValue::OptionValue(const mlir::OpPassManager &value) { setValue(value); } -llvm::cl::OptionValue::OptionValue( - const llvm::cl::OptionValue &rhs) { +OptionValue::OptionValue( + const OptionValue &rhs) { if (rhs.hasValue()) setValue(rhs.getValue()); } -llvm::cl::OptionValue & -llvm::cl::OptionValue::operator=( - const mlir::OpPassManager &rhs) { +OptionValue & +OptionValue::operator=(const mlir::OpPassManager &rhs) { setValue(rhs); return *this; } -llvm::cl::OptionValue::~OptionValue() = default; +OptionValue::~OptionValue() = default; -void llvm::cl::OptionValue::setValue( - const OpPassManager &newValue) { +void OptionValue::setValue(const OpPassManager &newValue) { if (hasValue()) *value = newValue; else value = std::make_unique(newValue); } -void llvm::cl::OptionValue::setValue(StringRef pipelineStr) { +void OptionValue::setValue(StringRef pipelineStr) { FailureOr pipeline = parsePassPipeline(pipelineStr); assert(succeeded(pipeline) && "invalid pass pipeline"); setValue(*pipeline); } -bool llvm::cl::OptionValue::compare( - const mlir::OpPassManager &rhs) const { +bool OptionValue::compare(const mlir::OpPassManager &rhs) const { std::string lhsStr, rhsStr; { raw_string_ostream lhsStream(lhsStr); @@ -466,17 +464,17 @@ bool llvm::cl::OptionValue::compare( return lhsStr == rhsStr; } -void llvm::cl::OptionValue::anchor() {} +void OptionValue::anchor() {} + +} // namespace llvm::cl //===----------------------------------------------------------------------===// // OpPassManager: Parser //===----------------------------------------------------------------------===// -namespace llvm { -namespace cl { +namespace llvm::cl { template class basic_parser; -} // namespace cl -} // namespace llvm +} // namespace llvm::cl bool llvm::cl::parser::parse(Option &, StringRef, StringRef arg, ParsedPassManager &value) {