25 lines · cpp
1//===--- ErrorBuilder.cpp - Helper for building error messages ------------===//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/Query/Matcher/ErrorBuilder.h"10#include "Diagnostics.h"11#include "llvm/ADT/Twine.h"12#include <initializer_list>13 14namespace mlir::query::matcher::internal {15 16void addError(Diagnostics *error, SourceRange range, ErrorType errorType,17 std::initializer_list<llvm::Twine> errorTexts) {18 Diagnostics::ArgStream argStream = error->addError(range, errorType);19 for (const llvm::Twine &errorText : errorTexts) {20 argStream << errorText;21 }22}23 24} // namespace mlir::query::matcher::internal25