mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-02 07:06:33 +00:00
Use formatv for the error instead of string stream.
PiperOrigin-RevId: 231507680
This commit is contained in:
parent
a759cf3190
commit
b52dd7f788
@ -39,6 +39,7 @@
|
|||||||
#include "llvm/IR/LLVMContext.h"
|
#include "llvm/IR/LLVMContext.h"
|
||||||
#include "llvm/IR/Module.h"
|
#include "llvm/IR/Module.h"
|
||||||
#include "llvm/IR/Type.h"
|
#include "llvm/IR/Type.h"
|
||||||
|
#include "llvm/Support/FormatVariadic.h"
|
||||||
#include "llvm/Support/ToolOutputFile.h"
|
#include "llvm/Support/ToolOutputFile.h"
|
||||||
|
|
||||||
using namespace mlir;
|
using namespace mlir;
|
||||||
@ -268,11 +269,8 @@ llvm::Type *ModuleLowerer::convertType(Type type) {
|
|||||||
return convertVectorType(vectorType);
|
return convertVectorType(vectorType);
|
||||||
|
|
||||||
MLIRContext *context = type.getContext();
|
MLIRContext *context = type.getContext();
|
||||||
std::string message;
|
context->emitError(UnknownLoc::get(context),
|
||||||
llvm::raw_string_ostream os(message);
|
llvm::formatv("unsupported type: {0}", type));
|
||||||
os << "unsupported type: ";
|
|
||||||
type.print(os);
|
|
||||||
context->emitError(UnknownLoc::get(context), os.str());
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user