reference, declaration → definition definition → references, declarations, derived classes, virtual overrides reference to multiple definitions → definitions unreferenced |
872 OS << "// Get the LLVM intrinsic that corresponds to a builtin.\n"; 873 OS << "// This is used by the C front-end. The builtin name is passed\n"; 874 OS << "// in as BuiltinName, and a target prefix (e.g. 'ppc') is passed\n"; 875 OS << "// in as TargetPrefix. The result is assigned to 'IntrinsicID'.\n"; 876 OS << "#ifdef GET_LLVM_INTRINSIC_FOR_" << CompilerName << "_BUILTIN\n"; 879 OS << "static " << TargetPrefix << "Intrinsic::ID " 883 OS << "Intrinsic::ID Intrinsic::getIntrinsicFor" << CompilerName 889 OS << " return "; 891 OS << "(" << TargetPrefix << "Intrinsic::ID)"; 892 OS << "Intrinsic::not_intrinsic;\n"; 893 OS << "}\n"; 894 OS << "#endif\n\n"; 898 OS << " static const char BuiltinNames[] = {\n"; 899 Table.EmitCharArray(OS); 900 OS << " };\n\n"; 902 OS << " struct BuiltinEntry {\n"; 903 OS << " Intrinsic::ID IntrinID;\n"; 904 OS << " unsigned StrTabOffset;\n"; 905 OS << " const char *getName() const {\n"; 906 OS << " return &BuiltinNames[StrTabOffset];\n"; 907 OS << " }\n"; 908 OS << " bool operator<(StringRef RHS) const {\n"; 909 OS << " return strncmp(getName(), RHS.data(), RHS.size()) < 0;\n"; 910 OS << " }\n"; 911 OS << " };\n"; 913 OS << " StringRef TargetPrefix(TargetPrefixStr);\n\n"; 917 OS << " "; 919 OS << "if (TargetPrefix == \"" << I->first << "\") "; 921 OS << "/* Target Independent Builtins */ "; 922 OS << "{\n"; 925 OS << " static const BuiltinEntry " << I->first << "Names[] = {\n"; 927 OS << " {Intrinsic::" << P.second << ", " 930 OS << " };\n"; 931 OS << " auto I = std::lower_bound(std::begin(" << I->first << "Names),\n"; 932 OS << " std::end(" << I->first << "Names),\n"; 933 OS << " BuiltinNameStr);\n"; 934 OS << " if (I != std::end(" << I->first << "Names) &&\n"; 935 OS << " I->getName() == BuiltinNameStr)\n"; 936 OS << " return I->IntrinID;\n"; 937 OS << " }\n"; 939 OS << " return "; 941 OS << "(" << TargetPrefix << "Intrinsic::ID)"; 942 OS << "Intrinsic::not_intrinsic;\n"; 943 OS << "}\n"; 944 OS << "#endif\n\n";