ac: fix build with recent LLVM
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Nov 2019 09:04:29 +0000 (10:04 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 14 Nov 2019 14:41:55 +0000 (14:41 +0000)
Build is broken since "Move CodeGenFileType enum to Support/CodeGen.h".

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/amd/llvm/ac_llvm_helper.cpp

index 7f3ff71fd9c952d133ff5588736b5f76c99b5b33..5bd7453b5088cb5462260803adf3b052c6680f2a 100644 (file)
@@ -192,7 +192,11 @@ struct ac_compiler_passes *ac_create_llvm_passes(LLVMTargetMachineRef tm)
 
        if (TM->addPassesToEmitFile(p->passmgr, p->ostream,
                                    nullptr,
+#if LLVM_VERSION_MAJOR >= 10
+                                   llvm::CGFT_ObjectFile)) {
+#else
                                    llvm::TargetMachine::CGFT_ObjectFile)) {
+#endif
                fprintf(stderr, "amd: TargetMachine can't emit a file of this type!\n");
                delete p;
                return NULL;