freebsd-ports/lang/beignet/files/patch-llvm6
Jan Beich ff6025f14f lang/beignet: unbreak with llvm70
backend/src/backend/program.cpp:797:34: error: reference to type 'const llvm::Module' could not bind to an lvalue of type 'llvm::Module *'
        llvm::WriteBitcodeToFile(*out_module, ostream);
                                 ^~~~~~~~~~~
/usr/local/llvm70/include/llvm/Bitcode/BitcodeWriter.h:129:41: note: passing argument to parameter 'M' here
  void WriteBitcodeToFile(const Module &M, raw_ostream &Out,
                                        ^
backend/src/llvm/llvm_bitcode_link.cpp:343:36: error: no matching function for call to 'CloneModule'
    llvm::Module * linked_module = llvm::CloneModule((llvm::Module*)mod).release();
                                   ^~~~~~~~~~~~~~~~~
/usr/local/llvm70/include/llvm/Transforms/Utils/Cloning.h:52:25: note: candidate function not viable: no known conversion from 'llvm::Module *' to 'const llvm::Module' for 1st argument; dereference the argument with *
std::unique_ptr<Module> CloneModule(const Module &M);
                        ^
/usr/local/llvm70/include/llvm/Transforms/Utils/Cloning.h:53:25: note: candidate function not viable: requires 2 arguments, but 1 was provided
std::unique_ptr<Module> CloneModule(const Module &M, ValueToValueMapTy &VMap);
                        ^
/usr/local/llvm70/include/llvm/Transforms/Utils/Cloning.h:60:1: note: candidate function not viable: requires 3 arguments, but 1 was provided
CloneModule(const Module &M, ValueToValueMapTy &VMap,
^
backend/src/llvm/ExpandLargeIntegers.cpp:230:5: error: use of undeclared identifier 'DEBUG'
    DEBUG(dbgs() << "\tRecording as forward PHI\n");
    ^
backend/src/llvm/ExpandLargeIntegers.cpp:237:5: error: use of undeclared identifier 'DEBUG'
    DEBUG(dbgs() << "\tTo:  " << *To.Lo << "\n");
    ^
backend/src/llvm/ExpandLargeIntegers.cpp:238:5: error: use of undeclared identifier 'DEBUG'
    DEBUG(dbgs() << "\tAnd: " << *To.Hi << "\n");
    ^
backend/src/llvm/ExpandLargeIntegers.cpp:247:5: error: use of undeclared identifier 'DEBUG'
    DEBUG(dbgs() << "\tTo:  " << *To << "\n");
    ^
backend/src/llvm/ExpandLargeIntegers.cpp:256:11: error: expected expression
    DEBUG(if (!ForwardPHIs.empty()) dbgs() << "Patching forward PHIs:\n");
          ^
backend/src/llvm/ExpandLargeIntegers.cpp:261:7: error: use of undeclared identifier 'DEBUG'
      DEBUG(dbgs() << "\t" << *F.Lo << "\n\t" << *F.Hi << "\n");
      ^
backend/src/llvm/ExpandLargeIntegers.cpp:389:3: error: use of undeclared identifier 'DEBUG'
  DEBUG(dbgs() << "Expanding Large Integer: " << *Inst << "\n");
  ^
backend/src/llvm/llvm_to_gen.cpp:142:13: error: use of undeclared identifier 'createInstructionCombiningPass'; did you mean 'createFunctionInliningPass'?
    MPM.add(createInstructionCombiningPass());// Clean up after IPCP & DAE
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend/src/llvm/llvm_to_gen.cpp:164:13: error: use of undeclared identifier 'createInstructionCombiningPass'; did you mean 'createFunctionInliningPass'?
    MPM.add(createInstructionCombiningPass());  // Combine silly seq's
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend/src/llvm/llvm_to_gen.cpp:172:13: error: use of undeclared identifier 'createInstructionCombiningPass'; did you mean 'createFunctionInliningPass'?
    MPM.add(createInstructionCombiningPass());
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend/src/llvm/llvm_to_gen.cpp:209:13: error: use of undeclared identifier 'createInstructionCombiningPass'; did you mean 'createFunctionInliningPass'?
    MPM.add(createInstructionCombiningPass());
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend/src/llvm/llvm_to_gen.cpp:215:13: error: use of undeclared identifier 'createInstructionCombiningPass'; did you mean 'createFunctionInliningPass'?
    MPM.add(createInstructionCombiningPass());  // Clean up after everything.
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend/src/llvm/llvm_to_gen.cpp:366:16: error: use of undeclared identifier 'createPromoteMemoryToRegisterPass'
    passes.add(createPromoteMemoryToRegisterPass());
               ^
backend/src/llvm/llvm_to_gen.cpp:373:16: error: use of undeclared identifier 'createInstructionCombiningPass'; did you mean 'createFunctionInliningPass'?
    passes.add(createInstructionCombiningPass());  // legalize will generate some silly instructions
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend/src/llvm/llvm_to_gen.cpp:380:16: error: use of undeclared identifier 'createLowerSwitchPass'; did you mean 'createLoopUnswitchPass'?
    passes.add(createLowerSwitchPass());           // simplify cfg will generate switch-case instruction
               ^~~~~~~~~~~~~~~~~~~~~
backend/src/backend/gen_program.cpp:452:32: error: reference to type 'const llvm::Module' could not bind to an rvalue of type 'llvm::Module *'
      llvm::WriteBitcodeToFile((llvm::Module*)prog->module, OS);
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/llvm70/include/llvm/Bitcode/BitcodeWriter.h:129:41: note: passing argument to parameter 'M' here
  void WriteBitcodeToFile(const Module &M, raw_ostream &Out,
                                        ^
backend/src/backend/gen_program.cpp:543:29: error: no matching function for call to 'CloneModule'
      llvm::Module* clone = llvm::CloneModule(src).release();
                            ^~~~~~~~~~~~~~~~~
/usr/local/llvm70/include/llvm/Transforms/Utils/Cloning.h:52:25: note: candidate function not viable: no known conversion from 'llvm::Module *' to 'const llvm::Module' for 1st argument; dereference the argument with *
std::unique_ptr<Module> CloneModule(const Module &M);
                        ^
/usr/local/llvm70/include/llvm/Transforms/Utils/Cloning.h:53:25: note: candidate function not viable: requires 2 arguments, but 1 was provided
std::unique_ptr<Module> CloneModule(const Module &M, ValueToValueMapTy &VMap);
                        ^
/usr/local/llvm70/include/llvm/Transforms/Utils/Cloning.h:60:1: note: candidate function not viable: requires 3 arguments, but 1 was provided
CloneModule(const Module &M, ValueToValueMapTy &VMap,
^
backend/src/backend/gen_program.cpp:452:32: error: reference to type 'const llvm::Module' could not bind to an rvalue of type 'llvm::Module *'
      llvm::WriteBitcodeToFile((llvm::Module*)prog->module, OS);
                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/llvm70/include/llvm/Bitcode/BitcodeWriter.h:129:41: note: passing argument to parameter 'M' here
  void WriteBitcodeToFile(const Module &M, raw_ostream &Out,
                                        ^

Obtained from:	upstream (via Debian)
Approved by:	portmgr blanket
2018-08-20 23:37:50 +00:00

39 lines
1.4 KiB
Text

commit 6e60548adee0
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Date: Sat Jul 21 20:04:00 2018 +0100
Add LLVM 6.0 support
LLVMContext::setDiagnosticHandler and LoopInfo::markAsRemoved
have been renamed.
Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
--- backend/src/llvm/llvm_to_gen.cpp.orig 2017-10-24 06:04:48 UTC
+++ backend/src/llvm/llvm_to_gen.cpp
@@ -322,7 +322,11 @@ namespace gbe
DataLayout DL(&mod);
gbeDiagnosticContext dc;
+#if LLVM_VERSION_MAJOR >= 6
+ mod.getContext().setDiagnosticHandlerCallBack(&gbeDiagnosticHandler,&dc);
+#else
mod.getContext().setDiagnosticHandler(&gbeDiagnosticHandler,&dc);
+#endif
#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 37
mod.setDataLayout(DL);
--- backend/src/llvm/llvm_unroll.cpp.orig 2017-10-24 06:04:48 UTC
+++ backend/src/llvm/llvm_unroll.cpp
@@ -205,7 +205,9 @@ namespace gbe {
if (parentTripCount != 0 && currTripCount * parentTripCount > 32) {
//Don't change the unrollID if doesn't force unroll.
//setUnrollID(parentL, false);
-#if LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
+#if LLVM_VERSION_MAJOR >= 6
+ loopInfo.erase(parentL);
+#elif LLVM_VERSION_MAJOR * 10 + LLVM_VERSION_MINOR >= 38
loopInfo.markAsRemoved(parentL);
#else
LPM.deleteLoopFromQueue(parentL);