summaryrefslogtreecommitdiff
path: root/include/llvm/Target/TargetIntrinsicInfo.h
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2009-11-05 03:19:08 +0000
committerMon P Wang <wangmp@apple.com>2009-11-05 03:19:08 +0000
commit82c443655d0b840d909bc0dc153ce02614a75f07 (patch)
tree0263a29da3e1f5c5a971247f5c0bc8a25cad7555 /include/llvm/Target/TargetIntrinsicInfo.h
parent98f2f1aff8dae1917497b090720c5f5a906ac40b (diff)
downloadllvm-82c443655d0b840d909bc0dc153ce02614a75f07.tar.gz
llvm-82c443655d0b840d909bc0dc153ce02614a75f07.tar.bz2
llvm-82c443655d0b840d909bc0dc153ce02614a75f07.tar.xz
Reintroduce support for overloading target intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86114 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target/TargetIntrinsicInfo.h')
-rw-r--r--include/llvm/Target/TargetIntrinsicInfo.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/include/llvm/Target/TargetIntrinsicInfo.h b/include/llvm/Target/TargetIntrinsicInfo.h
index d70aa7e9fd..ad8ac925e9 100644
--- a/include/llvm/Target/TargetIntrinsicInfo.h
+++ b/include/llvm/Target/TargetIntrinsicInfo.h
@@ -14,6 +14,8 @@
#ifndef LLVM_TARGET_TARGETINTRINSICINFO_H
#define LLVM_TARGET_TARGETINTRINSICINFO_H
+#include <string>
+
namespace llvm {
class Function;
@@ -32,7 +34,13 @@ public:
virtual ~TargetIntrinsicInfo();
/// Return the name of a target intrinsic, e.g. "llvm.bfin.ssync".
- virtual const char *getName(unsigned IntrID) const =0;
+ /// The Tys and numTys parameters are for intrinsics with overloaded types
+ /// (e.g., those using iAny or fAny). For a declaration for an overloaded
+ /// intrinsic, Tys should point to an array of numTys pointers to Type,
+ /// and must provide exactly one type for each overloaded type in the
+ /// intrinsic.
+ virtual std::string getName(unsigned IID, const Type **Tys = 0,
+ unsigned numTys = 0) const = 0;
/// Look up target intrinsic by name. Return intrinsic ID or 0 for unknown
/// names.
@@ -40,6 +48,15 @@ public:
/// Return the target intrinsic ID of a function, or 0.
virtual unsigned getIntrinsicID(Function *F) const;
+
+ /// Returns true if the intrinsic can be overloaded.
+ virtual bool isOverloaded(unsigned IID) const = 0;
+
+ /// Create or insert an LLVM Function declaration for an intrinsic,
+ /// and return it. The Tys and numTys are for intrinsics with overloaded
+ /// types. See above for more information.
+ virtual Function *getDeclaration(Module *M, unsigned ID, const Type **Tys = 0,
+ unsigned numTys = 0) const = 0;
};
} // End llvm namespace