From b4678b77f1e090e78935a50c98a4493ee2abda09 Mon Sep 17 00:00:00 2001 From: Hexcoder Date: Mon, 3 Jun 2019 23:20:47 +0200 Subject: fix llvm compatibility problems. Should compile now with llvm 3.8.0 up to llvm 8.0 --- llvm_mode/split-switches-pass.so.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'llvm_mode/split-switches-pass.so.cc') diff --git a/llvm_mode/split-switches-pass.so.cc b/llvm_mode/split-switches-pass.so.cc index 12be8a95..8d4db292 100644 --- a/llvm_mode/split-switches-pass.so.cc +++ b/llvm_mode/split-switches-pass.so.cc @@ -45,14 +45,10 @@ namespace { bool runOnModule(Module &M) override; -#if __clang_major__ >= 4 +#if LLVM_VERSION_MAJOR >= 4 StringRef getPassName() const override { #else - #ifndef __GNUG__ const char * getPassName() const override { - #else - StringRef getPassName() const override { - #endif #endif return "splits switch constructs"; } @@ -258,12 +254,8 @@ bool SplitSwitchesTransform::splitSwitches(Module &M) { /* Prepare cases vector. */ CaseVector Cases; for (SwitchInst::CaseIt i = SI->case_begin(), e = SI->case_end(); i != e; ++i) -#if __clang_major__ < 5 - #ifndef __GNUG__ +#if LLVM_VERSION_MAJOR < 5 Cases.push_back(CaseExpr(i.getCaseValue(), i.getCaseSuccessor())); - #else - Cases.push_back(CaseExpr(i->getCaseValue(), i->getCaseSuccessor())); - #endif #else Cases.push_back(CaseExpr(i->getCaseValue(), i->getCaseSuccessor())); #endif -- cgit 1.4.1