Unverified Commit 588523dd by wpan11nv Committed by GitHub

[LLVM] Fix build breaks from StringRef changes (#4923)

- llvm::StringRef to std::string conversion is explicit now.

Signed-off-by: Wei Pan <wpan11nv@nvidia.com>
parent a2429c1f
......@@ -236,7 +236,7 @@ runtime::Module BuildAMDGPU(Array<LoweredFunc> funcs, std::string target) {
llvm::SMDiagnostic err;
std::unique_ptr<llvm::Module> mlib = llvm::parseIRFile(path, err, *ctx);
if (mlib.get() == nullptr) {
std::string msg = err.getMessage();
std::string msg(err.getMessage());
LOG(FATAL) << "Fail to load bitcode file " << path << "\n"
<< "line " << err.getLineNo() << ":" << msg;
}
......
......@@ -215,7 +215,7 @@ runtime::Module BuildNVPTX(Array<LoweredFunc> funcs, std::string target) {
llvm::SMDiagnostic err;
std::unique_ptr<llvm::Module> mlib = llvm::parseIRFile(path, err, *ctx);
if (mlib.get() == nullptr) {
std::string msg = err.getMessage();
std::string msg(err.getMessage());
LOG(FATAL) << "Fail to load bitcode file " << path << "\n"
<< "line " << err.getLineNo() << ":" << msg;
}
......
......@@ -239,7 +239,7 @@ class LLVMModuleNode final : public runtime::ModuleNode {
if (mtarget != nullptr) {
llvm::MDString* pstr = llvm::dyn_cast<llvm::MDString>(mtarget);
CHECK(pstr != nullptr);
target_ = pstr->getString();
target_ = pstr->getString().str();
} else {
std::ostringstream os;
os << "llvm -target " << module_->getTargetTriple();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment