diff options
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Function.h | 2 | ||||
-rw-r--r-- | include/llvm/Intrinsics.h | 3 | ||||
-rw-r--r-- | include/llvm/Intrinsics.td | 2 | ||||
-rw-r--r-- | include/llvm/Module.h | 4 | ||||
-rw-r--r-- | include/llvm/Target/TargetIntrinsicInfo.h | 48 | ||||
-rw-r--r-- | include/llvm/Target/TargetMachine.h | 7 |
6 files changed, 64 insertions, 2 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 689d0e620d..942a5f00d5 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -129,7 +129,7 @@ public: /// The particular intrinsic functions which correspond to this value are /// defined in llvm/Intrinsics.h. /// - unsigned getIntrinsicID(bool noAssert = false) const; + unsigned getIntrinsicID() const; bool isIntrinsic() const { return getIntrinsicID() != 0; } /// getCallingConv()/setCallingConv(uint) - These method get and set the diff --git a/include/llvm/Intrinsics.h b/include/llvm/Intrinsics.h index b15b021f40..243359953b 100644 --- a/include/llvm/Intrinsics.h +++ b/include/llvm/Intrinsics.h @@ -63,6 +63,9 @@ namespace Intrinsic { /// intrinsic. Function *getDeclaration(Module *M, ID id, const Type **Tys = 0, unsigned numTys = 0); + + /// Map a GCC builtin name to an intrinsic ID. + ID getIntrinsicForGCCBuiltin(const char *Prefix, const char *BuiltinName); } // End Intrinsic namespace diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index 8145700f39..4ecc1a7052 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -144,6 +144,8 @@ class Intrinsic<list<LLVMType> ret_types, list<LLVMType> RetTypes = ret_types; list<LLVMType> ParamTypes = param_types; list<IntrinsicProperty> Properties = properties; + + bit isTarget = 0; } /// GCCBuiltin - If this intrinsic exactly corresponds to a GCC builtin, this diff --git a/include/llvm/Module.h b/include/llvm/Module.h index b0db50a379..aa2c449a02 100644 --- a/include/llvm/Module.h +++ b/include/llvm/Module.h @@ -213,6 +213,10 @@ public: Constant *getOrInsertFunction(const std::string &Name, const Type *RetTy, ...) END_WITH_NULL; + Constant *getOrInsertTargetIntrinsic(const std::string &Name, + const FunctionType *Ty, + AttrListPtr AttributeList); + /// getFunction - Look up the specified function in the module symbol table. /// If it does not exist, return null. Function *getFunction(const std::string &Name) const; diff --git a/include/llvm/Target/TargetIntrinsicInfo.h b/include/llvm/Target/TargetIntrinsicInfo.h index e69de29bb2..323e29afee 100644 --- a/include/llvm/Target/TargetIntrinsicInfo.h +++ b/include/llvm/Target/TargetIntrinsicInfo.h @@ -0,0 +1,48 @@ +//===-- llvm/Target/TargetIntrinsicInfo.h - Instruction Info ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file describes the target intrinsic instructions to the code generator. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_TARGET_TARGETINTRINSICINFO_H +#define LLVM_TARGET_TARGETINTRINSICINFO_H + +namespace llvm { + +class Function; +class Module; + +//--------------------------------------------------------------------------- +/// +/// TargetIntrinsicInfo - Interface to description of machine instruction set +/// +class TargetIntrinsicInfo { + + const char **Intrinsics; // Raw array to allow static init'n + unsigned NumIntrinsics; // Number of entries in the desc array + + TargetIntrinsicInfo(const TargetIntrinsicInfo &); // DO NOT IMPLEMENT + void operator=(const TargetIntrinsicInfo &); // DO NOT IMPLEMENT +public: + TargetIntrinsicInfo(const char **desc, unsigned num); + virtual ~TargetIntrinsicInfo(); + + unsigned getNumIntrinsics() const { return NumIntrinsics; } + + virtual Function *getDeclaration(Module *M, const char *BuiltinName) const { + return 0; + } + + virtual unsigned getIntrinsicID(Function *F) const { return 0; } +}; + +} // End llvm namespace + +#endif diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index b8bfc83aad..0be3286f71 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -23,6 +23,7 @@ class TargetAsmInfo; class TargetData; class TargetSubtarget; class TargetInstrInfo; +class TargetIntrinsicInfo; class TargetJITInfo; class TargetLowering; class TargetFrameInfo; @@ -118,7 +119,6 @@ public: virtual TargetLowering *getTargetLowering() const { return 0; } virtual const TargetData *getTargetData() const { return 0; } - /// getTargetAsmInfo - Return target specific asm information. /// const TargetAsmInfo *getTargetAsmInfo() const { @@ -141,6 +141,11 @@ public: /// details of graph coloring register allocation removed from it. /// virtual const TargetRegisterInfo *getRegisterInfo() const { return 0; } + + /// getIntrinsicInfo - If intrinsic information is available, return it. If + /// not, return null. + /// + virtual const TargetIntrinsicInfo *getIntrinsicInfo() const { return 0; } /// getJITInfo - If this target supports a JIT, return information for it, /// otherwise return null. |