diff options
author | Dale Johannesen <dalej@apple.com> | 2009-02-05 01:49:45 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2009-02-05 01:49:45 +0000 |
commit | fe5921a58b697ce8d9c423aaba11dc15bca9b8b1 (patch) | |
tree | 59d9fe3c8fd629dad52bd0a6a9760c95cf9dbbe3 /include | |
parent | c0b654dd9ae78311a0c89dee815eb7be66416fd2 (diff) | |
download | external_llvm-fe5921a58b697ce8d9c423aaba11dc15bca9b8b1.zip external_llvm-fe5921a58b697ce8d9c423aaba11dc15bca9b8b1.tar.gz external_llvm-fe5921a58b697ce8d9c423aaba11dc15bca9b8b1.tar.bz2 |
Reapply 63765. Patches for clang and llvm-gcc to follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-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 689d0e6..942a5f0 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 b15b021..2433599 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 8145700..4ecc1a7 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 b0db50a..aa2c449 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 e69de29..323e29a 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 b8bfc83..0be3286 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. |