Skip to content

Commit

Permalink
Fix compatibility with LLVM 12 and up (#1412)
Browse files Browse the repository at this point in the history
Upstream LLVM stopped using the compatibility
spellings of OF_{None,Text,Append} from version 12 and up.

https://reviews.llvm.org/D101650

Signed-off-by: Luya Tshimbalanga <luya@fedoraproject.org>
  • Loading branch information
luyatshimbalanga authored and lgritz committed Oct 24, 2021
1 parent b37cd9c commit eb67611
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/liboslexec/llvm_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,9 @@ LLVM_Util::make_jit_execengine (std::string *err,

options.NoZerosInBSS = false;
options.GuaranteedTailCallOpt = false;
#if OSL_LLVM_VERSION < 120
options.StackAlignmentOverride = 0;
#endif
options.FunctionSections = true;
options.UseInitArray = false;
options.FloatABIType = llvm::FloatABI::Default;
Expand Down Expand Up @@ -2989,7 +2991,7 @@ void
LLVM_Util::write_bitcode_file (const char *filename, std::string *err)
{
std::error_code local_error;
llvm::raw_fd_ostream out (filename, local_error, llvm::sys::fs::F_None);
llvm::raw_fd_ostream out (filename, local_error, llvm::sys::fs::OF_None);
if (! out.has_error()) {
llvm::WriteBitcodeToFile (*module(), out);
if (err && local_error)
Expand Down Expand Up @@ -3051,7 +3053,9 @@ LLVM_Util::ptx_compile_group (llvm::Module* lib_module, const std::string& name,
options.AllowFPOpFusion = llvm::FPOpFusion::Fast;
options.NoZerosInBSS = 0;
options.GuaranteedTailCallOpt = 0;
#if OSL_LLVM_VERSION < 120
options.StackAlignmentOverride = 0;
#endif
options.UseInitArray = 0;

llvm::TargetMachine* target_machine = llvm_target->createTargetMachine(
Expand Down

0 comments on commit eb67611

Please sign in to comment.