Skip to content

Commit

Permalink
[LLVM] Fix build breaks from StringRef changes (apache#4923)
Browse files Browse the repository at this point in the history
- llvm::StringRef to std::string conversion is explicit now.

Signed-off-by: Wei Pan <wpan11nv@nvidia.com>
  • Loading branch information
wpan11nv authored and zhiics committed Mar 2, 2020
1 parent d420abf commit ead3585
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/target/llvm/codegen_amdgpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/target/llvm/codegen_nvptx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/target/llvm/llvm_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit ead3585

Please sign in to comment.