KSeExpr 6.0.0.0
ExprLLVMAll.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2011-2019 Disney Enterprises, Inc.
2// SPDX-License-Identifier: LicenseRef-Apache-2.0
3// SPDX-FileCopyrightText: 2020 L. E. Segovia <amy@amyspark.me>
4// SPDX-License-Identifier: GPL-3.0-or-later
5
6#pragma once
7
8#include "ExprConfig.h"
9#include "ExprLLVM.h"
10
11#if defined(SEEXPR_ENABLE_LLVM)
12#ifndef Q_MOC_RUN /* automoc chokes in Qt classes using llvm/ir/intrinsics.h indirectly*/
13#include <llvm/ADT/ArrayRef.h>
14#include <llvm/Analysis/Passes.h>
15#include <llvm/Config/llvm-config.h>
16#include <llvm/ExecutionEngine/ExecutionEngine.h>
17#include <llvm/ExecutionEngine/GenericValue.h>
18#include <llvm/ExecutionEngine/Interpreter.h>
19#include <llvm/ExecutionEngine/MCJIT.h>
20#include <llvm/ExecutionEngine/SectionMemoryManager.h>
21#include <llvm/IR/Constants.h>
22#include <llvm/IR/DataLayout.h>
23#include <llvm/IR/DerivedTypes.h>
24#include <llvm/IR/Function.h>
25#include <llvm/IR/InstrTypes.h>
26#include <llvm/IR/Intrinsics.h>
27#include <llvm/IR/LLVMContext.h>
28#include <llvm/IR/LegacyPassManager.h>
29#include <llvm/IR/Module.h>
30#include <llvm/IR/PassManager.h>
31#include <llvm/IR/Type.h>
32#include <llvm/IR/Verifier.h>
33#include <llvm/InitializePasses.h>
34#include <llvm/LinkAllPasses.h>
35#include <llvm/Support/Compiler.h>
36#include <llvm/Support/DynamicLibrary.h>
37#include <llvm/Support/ManagedStatic.h>
38#include <llvm/Support/TargetSelect.h>
39#include <llvm/Transforms/IPO/PassManagerBuilder.h>
40#include <llvm/Transforms/Utils/BasicBlockUtils.h>
41#include <llvm/Transforms/Utils/Cloning.h>
42#include <memory>
43
44#if LLVM_VERSION_MAJOR >= 13
45#define IN_BOUNDS_GEP(Builder, firstArg, idx) Builder.CreateInBoundsGEP(firstArg->getType()->getScalarType()->getPointerElementType(), firstArg, idx)
46#define CREATE_LOAD(Builder, indexVar) Builder.CreateLoad(indexVar->getType()->getPointerElementType(), indexVar)
47#define CREATE_LOAD_WITH_ID(Builder, indexVar, id) Builder.CreateLoad(indexVar->getType()->getPointerElementType(), indexVar, id)
48#define CREATE_CONST_GEP1_32(Builder, a, b) Builder.CreateConstGEP1_32(a->getType()->getPointerElementType(), a, b)
49#else
50#define IN_BOUNDS_GEP(Builder, firstArg, idx) Builder.CreateInBoundsGEP(firstArg, idx)
51#define CREATE_LOAD(Builder, indexVar) Builder.CreateLoad(indexVar)
52#define CREATE_LOAD_WITH_ID(Builder, indexVar, id) Builder.CreateLoad(indexVar, id)
53#define CREATE_CONST_GEP1_32(Builder, a, b) Builder.CreateConstGEP1_32(a, b)
54#endif // LLVM_VERSION_MAJOR >= 13
55#endif // Q_MOC_RUN
56#endif