mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Use StringRef in TableGen generated Intrinsics.gen file (NFC)
llvm-svn: 283792
This commit is contained in:
parent
14c600c960
commit
3003721ba0
@ -88,10 +88,10 @@ namespace Intrinsic {
|
|||||||
StringRef Name);
|
StringRef Name);
|
||||||
|
|
||||||
/// Map a GCC builtin name to an intrinsic ID.
|
/// Map a GCC builtin name to an intrinsic ID.
|
||||||
ID getIntrinsicForGCCBuiltin(const char *Prefix, const char *BuiltinName);
|
ID getIntrinsicForGCCBuiltin(const char *Prefix, StringRef BuiltinName);
|
||||||
|
|
||||||
/// Map a MS builtin name to an intrinsic ID.
|
/// Map a MS builtin name to an intrinsic ID.
|
||||||
ID getIntrinsicForMSBuiltin(const char *Prefix, const char *BuiltinName);
|
ID getIntrinsicForMSBuiltin(const char *Prefix, StringRef BuiltinName);
|
||||||
|
|
||||||
/// This is a type descriptor which explains the type requirements of an
|
/// This is a type descriptor which explains the type requirements of an
|
||||||
/// intrinsic. This is returned by getIntrinsicInfoTableEntries.
|
/// intrinsic. This is returned by getIntrinsicInfoTableEntries.
|
||||||
|
@ -714,11 +714,11 @@ void IntrinsicEmitter::EmitIntrinsicToBuiltinMap(
|
|||||||
if (TargetOnly) {
|
if (TargetOnly) {
|
||||||
OS << "static " << TargetPrefix << "Intrinsic::ID "
|
OS << "static " << TargetPrefix << "Intrinsic::ID "
|
||||||
<< "getIntrinsicFor" << CompilerName << "Builtin(const char "
|
<< "getIntrinsicFor" << CompilerName << "Builtin(const char "
|
||||||
<< "*TargetPrefixStr, const char *BuiltinNameStr) {\n";
|
<< "*TargetPrefixStr, StringRef BuiltinNameStr) {\n";
|
||||||
} else {
|
} else {
|
||||||
OS << "Intrinsic::ID Intrinsic::getIntrinsicFor" << CompilerName
|
OS << "Intrinsic::ID Intrinsic::getIntrinsicFor" << CompilerName
|
||||||
<< "Builtin(const char "
|
<< "Builtin(const char "
|
||||||
<< "*TargetPrefixStr, const char *BuiltinNameStr) {\n";
|
<< "*TargetPrefixStr, StringRef BuiltinNameStr) {\n";
|
||||||
}
|
}
|
||||||
OS << " static const char BuiltinNames[] = {\n";
|
OS << " static const char BuiltinNames[] = {\n";
|
||||||
Table.EmitCharArray(OS);
|
Table.EmitCharArray(OS);
|
||||||
@ -730,13 +730,11 @@ void IntrinsicEmitter::EmitIntrinsicToBuiltinMap(
|
|||||||
OS << " const char *getName() const {\n";
|
OS << " const char *getName() const {\n";
|
||||||
OS << " return &BuiltinNames[StrTabOffset];\n";
|
OS << " return &BuiltinNames[StrTabOffset];\n";
|
||||||
OS << " }\n";
|
OS << " }\n";
|
||||||
OS << " bool operator<(const char *RHS) const {\n";
|
OS << " bool operator<(StringRef RHS) const {\n";
|
||||||
OS << " return strcmp(getName(), RHS) < 0;\n";
|
OS << " return strncmp(getName(), RHS.data(), RHS.size()) < 0;\n";
|
||||||
OS << " }\n";
|
OS << " }\n";
|
||||||
OS << " };\n";
|
OS << " };\n";
|
||||||
|
|
||||||
|
|
||||||
OS << " StringRef BuiltinName(BuiltinNameStr);\n";
|
|
||||||
OS << " StringRef TargetPrefix(TargetPrefixStr);\n\n";
|
OS << " StringRef TargetPrefix(TargetPrefixStr);\n\n";
|
||||||
|
|
||||||
// Note: this could emit significantly better code if we cared.
|
// Note: this could emit significantly better code if we cared.
|
||||||
@ -759,7 +757,7 @@ void IntrinsicEmitter::EmitIntrinsicToBuiltinMap(
|
|||||||
OS << " std::end(" << I->first << "Names),\n";
|
OS << " std::end(" << I->first << "Names),\n";
|
||||||
OS << " BuiltinNameStr);\n";
|
OS << " BuiltinNameStr);\n";
|
||||||
OS << " if (I != std::end(" << I->first << "Names) &&\n";
|
OS << " if (I != std::end(" << I->first << "Names) &&\n";
|
||||||
OS << " strcmp(I->getName(), BuiltinNameStr) == 0)\n";
|
OS << " I->getName() == BuiltinNameStr)\n";
|
||||||
OS << " return I->IntrinID;\n";
|
OS << " return I->IntrinID;\n";
|
||||||
OS << " }\n";
|
OS << " }\n";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user