IntrinsicInfo.h
Go to the documentation of this file.00001
00002 #ifndef IntrinsicInfo_H
00003 #define IntrinsicInfo_H
00004
00005 #include <map>
00006 #include "Open64BasicTypes.h"
00007
00008 class IntrinsicInfo {
00009
00010 public:
00011
00015 static bool isIntrinsic(WN* aWN_p);
00016
00020 static const char* intrinsicBaseName(INTRINSIC opcode);
00021
00025 struct Key {
00026 Key(const OPERATOR& opr, const char* name): myWNopr(opr), myName(name) {};
00027 OPERATOR myWNopr;
00028 const char* myName;
00029 };
00030
00034 struct KeyLT {
00035 bool operator()(const Key& k1, const Key& k2) const;
00036 };
00037
00038
00042 enum IntrinsicType_E{
00043 FLOAT_INTR,
00044 INTEGER_INTR,
00045 STRING_INTR,
00046 BOOL_INTR,
00047 IO_INTR,
00048 ARRAY_INTR,
00049 COMPILER_INTERNAL_INTR,
00050 UNDEFINED_INTR_TYPE
00051 };
00052
00053
00057 struct Info {
00058 Info(): myVarOps(false), myNumOp(0), myType(UNDEFINED_INTR_TYPE) {};
00059 Info(bool varOps, unsigned int aNumOp,IntrinsicType_E aType): myVarOps(varOps), myNumOp(aNumOp), myType(aType){};
00060 bool myVarOps;
00061 unsigned int myNumOp;
00062 IntrinsicType_E myType;
00063 };
00064
00068 static const Info& getIntrinsicInfo(WN* aWN_p);
00069
00070 typedef std::map<Key,Info,KeyLT> IntrinsicMap;
00071
00072 static const IntrinsicMap& getMap();
00073
00074 private:
00075
00079 IntrinsicInfo();
00080
00084 ~IntrinsicInfo();
00085
00086 static IntrinsicMap ourIntrinsicInfoMap;
00087 static bool ourInitFlag;
00088
00094 static bool lookupIntrinsicPrefix(const char* str);
00095
00099 static bool lookupIntrinsicInfo(WN* aWN_p, const Info* anInfo);
00100
00101 };
00102
00103 #endif
00104