27 lines · cpp
1//===- Constraint.cpp -----------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "mlir/Tools/PDLL/ODS/Constraint.h"10 11using namespace mlir;12using namespace mlir::pdll::ods;13 14//===----------------------------------------------------------------------===//15// Constraint16//===----------------------------------------------------------------------===//17 18StringRef Constraint::getDemangledName() const {19 StringRef demangledName = name;20 21 // Drop the "anonymous" suffix if present.22 size_t anonymousSuffix = demangledName.find("(anonymous_");23 if (anonymousSuffix != StringRef::npos)24 demangledName = demangledName.take_front(anonymousSuffix);25 return demangledName;26}27