Fix LLVM compilation issues and use the new attrs
This implements #[no_split_stack] and also changes #[fast_ffi] to using the new "fixedstacksegment" string attribute instead of integer attribute.
This commit is contained in:
@@ -43,7 +43,7 @@ extern "C" void LLVMRustAddPrintModulePass(LLVMPassManagerRef PMR,
|
||||
const char* path) {
|
||||
PassManager *PM = unwrap<PassManager>(PMR);
|
||||
std::string ErrorInfo;
|
||||
raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary);
|
||||
raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_Binary);
|
||||
formatted_raw_ostream FOS(OS);
|
||||
PM->add(createPrintModulePass(&FOS));
|
||||
PM->run(*unwrap(M));
|
||||
@@ -412,7 +412,7 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
|
||||
bool NoVerify = false;
|
||||
std::string ErrorInfo;
|
||||
raw_fd_ostream OS(path, ErrorInfo,
|
||||
raw_fd_ostream::F_Binary);
|
||||
sys::fs::F_Binary);
|
||||
if (ErrorInfo != "") {
|
||||
LLVMRustError = ErrorInfo.c_str();
|
||||
return false;
|
||||
@@ -481,6 +481,10 @@ extern "C" LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C) {
|
||||
return wrap(Type::getMetadataTy(*unwrap(C)));
|
||||
}
|
||||
|
||||
extern "C" void LLVMAddFunctionAttrString(LLVMValueRef fn, const char *Name) {
|
||||
unwrap<Function>(fn)->addFnAttr(Name);
|
||||
}
|
||||
|
||||
extern "C" LLVMValueRef LLVMBuildAtomicLoad(LLVMBuilderRef B,
|
||||
LLVMValueRef source,
|
||||
const char* Name,
|
||||
@@ -624,7 +628,7 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateFunction(
|
||||
return wrap(Builder->createFunction(
|
||||
unwrapDI<DIScope>(Scope), Name, LinkageName,
|
||||
unwrapDI<DIFile>(File), LineNo,
|
||||
unwrapDI<DIType>(Ty), isLocalToUnit, isDefinition, ScopeLine,
|
||||
unwrapDI<DICompositeType>(Ty), isLocalToUnit, isDefinition, ScopeLine,
|
||||
Flags, isOptimized,
|
||||
unwrap<Function>(Fn),
|
||||
unwrapDI<MDNode*>(TParam),
|
||||
|
||||
Reference in New Issue
Block a user