Skip to content

Commit

Permalink
CodeGenFileType moved outside TargetMachine
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jan 7, 2020
1 parent 2fd4e76 commit 3ec3aa7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/rustllvm/PassWrapper.cpp
Expand Up @@ -533,6 +533,18 @@ enum class LLVMRustFileType {
ObjectFile,
};

#if LLVM_VERSION_GE(10, 0)
static CodeGenFileType fromRust(LLVMRustFileType Type) {
switch (Type) {
case LLVMRustFileType::AssemblyFile:
return CGFT_AssemblyFile;
case LLVMRustFileType::ObjectFile:
return CGFT_ObjectFile;
default:
report_fatal_error("Bad FileType.");
}
}
#else
static TargetMachine::CodeGenFileType fromRust(LLVMRustFileType Type) {
switch (Type) {
case LLVMRustFileType::AssemblyFile:
Expand All @@ -543,6 +555,7 @@ static TargetMachine::CodeGenFileType fromRust(LLVMRustFileType Type) {
report_fatal_error("Bad FileType.");
}
}
#endif

extern "C" LLVMRustResult
LLVMRustWriteOutputFile(LLVMTargetMachineRef Target, LLVMPassManagerRef PMR,
Expand Down

0 comments on commit 3ec3aa7

Please sign in to comment.