void-packages/srcpkgs/ispc/patches/87b5f3a25d19023ba6022b6175a366ab1703fd97.patch
Rasmus Thomsen 55d9d9173e
ispc: rebuild against libLLVM-7
[ci skip]
2018-12-26 10:58:31 -02:00

53 lines
1.9 KiB
Diff

From 87b5f3a25d19023ba6022b6175a366ab1703fd97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20B=C3=B6hm?= <suluke93@gmail.com>
Date: Tue, 10 Apr 2018 09:39:56 +0200
Subject: [PATCH] Include new header llvm/Transforms/Utils.h where needed
cbackend.cpp uses createLowerInvokePass
opt.cpp uses createPromoteMemoryToRegisterPass
These functions were moved to the named header with commit 328717, which will
be part of the llvm 7.0 release.
Phabricator url: https://reviews.llvm.org/rL328717
---
cbackend.cpp | 5 ++++-
opt.cpp | 3 +++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/cbackend.cpp b/cbackend.cpp
index 095ba106..2da435f9 100644
--- a/cbackend.cpp
+++ b/cbackend.cpp
@@ -93,6 +93,9 @@
#include "llvm/CodeGen/IntrinsicLowering.h"
//#include "llvm/Target/Mangler.h"
#include "llvm/Transforms/Scalar.h"
+#if ISPC_LLVM_VERSION >= ISPC_LLVM_7_0
+ #include "llvm/Transforms/Utils.h"
+#endif
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInstrInfo.h"
@@ -1629,7 +1632,7 @@ void CWriter::printConstant(llvm::Constant *CPV, bool Static) {
Out << "\"";
//const uint64_t *Ptr64 = CPV->getUniqueInteger().getRawData();
const uint64_t *Ptr64 = CI->getValue().getRawData();
- for (int i = 0; i < Ty->getPrimitiveSizeInBits(); i++) {
+ for (unsigned i = 0; i < Ty->getPrimitiveSizeInBits(); i++) {
Out << ((Ptr64[i / (sizeof (uint64_t) * 8)] >> (i % (sizeof (uint64_t) * 8))) & 1);
}
Out << "\"";
diff --git a/opt.cpp b/opt.cpp
index ef9e4c5d..1edbe33b 100644
--- a/opt.cpp
+++ b/opt.cpp
@@ -99,6 +99,9 @@
#include <llvm/ADT/SmallSet.h>
#include <llvm/Transforms/Scalar.h>
#include <llvm/Transforms/IPO.h>
+#if ISPC_LLVM_VERSION >= ISPC_LLVM_7_0
+ #include "llvm/Transforms/Utils.h"
+#endif
#include <llvm/Transforms/Utils/BasicBlockUtils.h>
#include <llvm/Target/TargetOptions.h>
#if ISPC_LLVM_VERSION == ISPC_LLVM_3_2