GCStrategy: Use Twine properly for error message (#132760)
This commit is contained in:
@@ -41,10 +41,9 @@ std::unique_ptr<GCStrategy> llvm::getGCStrategy(const StringRef Name) {
|
||||
// be the builtin GCs if nothing else. The most likely scenario here is
|
||||
// that we got here without running the initializers used by the Registry
|
||||
// itself and it's registration mechanism.
|
||||
const std::string error =
|
||||
std::string("unsupported GC: ") + Name.str() +
|
||||
" (did you remember to link and initialize the library?)";
|
||||
report_fatal_error(Twine(error));
|
||||
report_fatal_error(
|
||||
"unsupported GC: " + Name +
|
||||
" (did you remember to link and initialize the library?)");
|
||||
} else
|
||||
report_fatal_error(Twine(std::string("unsupported GC: ") + Name.str()));
|
||||
report_fatal_error(Twine("unsupported GC: ") + Name);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: not --crash opt -disable-output -passes=rewrite-statepoints-for-gc %s 2>&1 | FileCheck %s
|
||||
|
||||
; CHECK: LLVM ERROR: unsupported GC: unsupported-gc
|
||||
|
||||
declare void @g()
|
||||
declare i32 @h()
|
||||
|
||||
define ptr addrspace(1) @f0(ptr addrspace(1) %arg) gc "unsupported-gc" {
|
||||
call void @g() [ "deopt"(i32 100) ]
|
||||
ret ptr addrspace(1) %arg
|
||||
}
|
||||
Reference in New Issue
Block a user