We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa9d02e commit 6d59017Copy full SHA for 6d59017
src/rustllvm/RustWrapper.cpp
@@ -1003,11 +1003,19 @@ inline section_iterator *unwrap(LLVMSectionIteratorRef SI) {
1003
1004
extern "C" size_t LLVMRustGetSectionName(LLVMSectionIteratorRef SI,
1005
const char **Ptr) {
1006
+#if LLVM_VERSION_GE(10, 0)
1007
+ auto NameOrErr = (*unwrap(SI))->getName();
1008
+ if (!NameOrErr)
1009
+ report_fatal_error(NameOrErr.takeError());
1010
+ *Ptr = NameOrErr->data();
1011
+ return NameOrErr->size();
1012
+#else
1013
StringRef Ret;
1014
if (std::error_code EC = (*unwrap(SI))->getName(Ret))
1015
report_fatal_error(EC.message());
1016
*Ptr = Ret.data();
1017
return Ret.size();
1018
+#endif
1019
}
1020
1021
// LLVMArrayType function does not support 64-bit ElementCount
0 commit comments