Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions mlir/include/mlir/Bindings/Python/IRCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ class MLIR_PYTHON_API_EXPORTED PyConcreteType : public BaseTy {
if (!DerivedTy::isaFunction(orig)) {
auto origRepr =
nanobind::cast<std::string>(nanobind::repr(nanobind::cast(orig)));
throw nanobind::value_error((llvm::Twine("Cannot cast type to ") +
throw nanobind::value_error((::llvm::Twine("Cannot cast type to ") +
DerivedTy::pyClassName + " (from " +
origRepr + ")")
.str()
Expand All @@ -966,7 +966,7 @@ class MLIR_PYTHON_API_EXPORTED PyConcreteType : public BaseTy {
if (DerivedTy::getTypeIdFunction)
return PyTypeID(DerivedTy::getTypeIdFunction());
throw nanobind::attribute_error(
(DerivedTy::pyClassName + llvm::Twine(" has no typeid."))
(DerivedTy::pyClassName + ::llvm::Twine(" has no typeid."))
.str()
.c_str());
},
Expand Down Expand Up @@ -1080,7 +1080,7 @@ class MLIR_PYTHON_API_EXPORTED PyConcreteAttribute : public BaseTy {
if (!DerivedTy::isaFunction(orig)) {
auto origRepr =
nanobind::cast<std::string>(nanobind::repr(nanobind::cast(orig)));
throw nanobind::value_error((llvm::Twine("Cannot cast attribute to ") +
throw nanobind::value_error((::llvm::Twine("Cannot cast attribute to ") +
DerivedTy::pyClassName + " (from " +
origRepr + ")")
.str()
Expand Down Expand Up @@ -1110,7 +1110,7 @@ class MLIR_PYTHON_API_EXPORTED PyConcreteAttribute : public BaseTy {
if (DerivedTy::getTypeIdFunction)
return PyTypeID(DerivedTy::getTypeIdFunction());
throw nanobind::attribute_error(
(DerivedTy::pyClassName + llvm::Twine(" has no typeid."))
(DerivedTy::pyClassName + ::llvm::Twine(" has no typeid."))
.str()
.c_str());
},
Expand Down Expand Up @@ -1324,7 +1324,7 @@ class MLIR_PYTHON_API_EXPORTED PySymbolTable {
/// Custom exception that allows access to error diagnostic information. This is
/// converted to the `ir.MLIRError` python exception when thrown.
struct MLIR_PYTHON_API_EXPORTED MLIRError {
MLIRError(llvm::Twine message,
MLIRError(::llvm::Twine message,
std::vector<PyDiagnostic::DiagnosticInfo> &&errorDiagnostics = {})
: message(message.str()), errorDiagnostics(std::move(errorDiagnostics)) {}
std::string message;
Expand Down Expand Up @@ -1544,7 +1544,7 @@ class MLIR_PYTHON_API_EXPORTED PyConcreteValue : public PyValue {
if (!DerivedTy::isaFunction(orig.get())) {
auto origRepr =
nanobind::cast<std::string>(nanobind::repr(nanobind::cast(orig)));
throw nanobind::value_error((Twine("Cannot cast value to ") +
throw nanobind::value_error((::llvm::Twine("Cannot cast value to ") +
DerivedTy::pyClassName + " (from " +
origRepr + ")")
.str()
Expand All @@ -1555,11 +1555,11 @@ class MLIR_PYTHON_API_EXPORTED PyConcreteValue : public PyValue {

/// Binds the Python module objects to functions of this class.
static void bind(nanobind::module_ &m) {
auto cls = ClassTy(
m, DerivedTy::pyClassName, nanobind::is_generic(),
nanobind::sig((Twine("class ") + DerivedTy::pyClassName + "(Value[_T])")
.str()
.c_str()));
auto cls = ClassTy(m, DerivedTy::pyClassName, nanobind::is_generic(),
nanobind::sig((::llvm::Twine("class ") +
DerivedTy::pyClassName + "(Value[_T])")
.str()
.c_str()));
cls.def(nanobind::init<PyValue &>(), nanobind::keep_alive<0, 1>(),
nanobind::arg("value"));
cls.def(
Expand Down