/* * (C) 2010 by Computer System Laboratory, IIS, Academia Sinica, Taiwan. * See COPYRIGHT in top-level directory. */ #ifndef __LLVM_TYPES_H #define __LLVM_TYPES_H #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Type.h" #include "llvm/IR/Module.h" #include "llvm/IR/Function.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/Constants.h" #include "llvm/IR/GlobalVariable.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/InlineAsm.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Attributes.h" #include "llvm/IR/GetElementPtrTypeIterator.h" #include "llvm/IR/Operator.h" #include "llvm/IR/Verifier.h" #include "llvm/IR/ValueHandle.h" #include "llvm/IR/ValueSymbolTable.h" #include "llvm/IR/InstIterator.h" #include "llvm/IR/IRBuilder.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/Analysis/CFG.h" #include "llvm/Analysis/CodeMetrics.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/Analysis/AssumptionCache.h" #include "llvm/IRReader/IRReader.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/DynamicLibrary.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/Host.h" #include "llvm/Support/CommandLine.h" #include "llvm/Transforms/Utils/Cloning.h" #if defined(LLVM_V35) #include "llvm/MC/MCDisassembler.h" #include "llvm/ExecutionEngine/ObjectImage.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Support/MemoryObject.h" #elif defined(LLVM_V38) #include "llvm/MC/MCDisassembler.h" #include "llvm/Object/SymbolSize.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" #include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Support/MemoryObject.h" #elif defined(LLVM_V39) #include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/Object/SymbolSize.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" #include "llvm/Support/MemoryObject.h" #else #include "llvm/MC/MCDisassembler/MCDisassembler.h" #include "llvm/Object/SymbolSize.h" #include "llvm/DebugInfo/DWARF/DWARFContext.h" #endif #include #include #include #include "llvm-macro.h" #include "qemu-types.h" using namespace llvm; class HelperInfo; typedef std::vector TBVec; typedef std::vector > RestoreVec; typedef std::map TCGHelperMap; /* */ typedef std::map HelperMap; typedef std::map SymbolMap; typedef std::map FlatType; /* */ typedef std::vector IVec; typedef std::vector BBVec; static inline const DataLayout *getDataLayout(Module *Mod) { #if defined(LLVM_V35) return Mod->getDataLayout(); #else return &Mod->getDataLayout(); #endif } static inline AllocaInst *CreateAlloca(Type *Ty, unsigned AddrSpace, const Twine &Name, Instruction *InsertBefore = nullptr) { #if defined(LLVM_V35) || defined(LLVM_V38) || defined(LLVM_V39) return new AllocaInst(Ty, Name, InsertBefore); #else return new AllocaInst(Ty, AddrSpace, Name, InsertBefore); #endif } static inline AllocaInst *CreateAlloca(Type *Ty, unsigned AddrSpace, Value *ArraySize = nullptr, const Twine &Name = "", Instruction *InsertBefore = nullptr) { #if defined(LLVM_V35) || defined(LLVM_V38) || defined(LLVM_V39) return new AllocaInst(Ty, ArraySize, Name, InsertBefore); #else return new AllocaInst(Ty, AddrSpace, ArraySize, Name, InsertBefore); #endif } static inline void InlineFunc(CallInst *CI) { #if defined(LLVM_V38) || defined(LLVM_V39) AssumptionCacheTracker ACT; InlineFunctionInfo IFI(nullptr, &ACT); #else InlineFunctionInfo IFI; #endif InlineFunction(CI, IFI); } #endif /* * vim: ts=8 sts=4 sw=4 expandtab */