From 5e5d42b918852a7aeb12bbc98cf4a5b46e5f9842 Mon Sep 17 00:00:00 2001 From: Matt Pharr Date: Tue, 6 Aug 2013 17:55:37 -0700 Subject: [PATCH] Fix build with LLVM 3.1 --- opt.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opt.cpp b/opt.cpp index 3e2efcd8..e1618b7a 100644 --- a/opt.cpp +++ b/opt.cpp @@ -4556,6 +4556,8 @@ PeepholePass::PeepholePass() : BasicBlockPass(ID) { } +#ifndef LLVM_3_1 + using namespace llvm::PatternMatch; template @@ -4706,6 +4708,7 @@ inline SDiv2_match m_SDiv2(const V &v) { return SDiv2_match(v); } + // Returns true if the given function has a call to an intrinsic function // in its definition. static bool @@ -4874,6 +4877,7 @@ lMatchAvgDownInt16(llvm::Value *inst) { } return NULL; } +#endif // !LLVM_3_1 bool PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) { @@ -4885,6 +4889,7 @@ PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) { llvm::Instruction *inst = &*iter; llvm::Instruction *builtinCall = NULL; +#ifndef LLVM_3_1 if (!builtinCall) builtinCall = lMatchAvgUpUInt8(inst); if (!builtinCall) @@ -4901,7 +4906,7 @@ PeepholePass::runOnBasicBlock(llvm::BasicBlock &bb) { builtinCall = lMatchAvgDownInt8(inst); if (!builtinCall) builtinCall = lMatchAvgDownInt16(inst); - +#endif // LLVM_3_1 if (builtinCall != NULL) { llvm::ReplaceInstWithInst(inst, builtinCall); modifiedAny = true;