forked from OSchip/llvm-project
Add comments and an assert to follow-up on r279113. NFC.
Philip commented on r279113 to ask for better comments as to when to use the different versions of getName. Its also possible to assert in the simple case that we aren't an overloaded intrinsic as those have to use the more capable version of getName. Thanks for the comments Philip. llvm-svn: 279466
This commit is contained in:
parent
775b554129
commit
a5f8c722c4
|
@ -45,9 +45,15 @@ namespace Intrinsic {
|
|||
};
|
||||
|
||||
/// Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
|
||||
/// Note, this version is for intrinsics with no overloads. Use the other
|
||||
/// version of getName if overloads are required.
|
||||
StringRef getName(ID id);
|
||||
|
||||
/// Return the LLVM name for an intrinsic, such as "llvm.ppc.altivec.lvx".
|
||||
/// Note, this version of getName supports overloads, but is less efficient
|
||||
/// than the StringRef version of this function. If no overloads are
|
||||
/// requried, it is safe to use this version, but better to use the StringRef
|
||||
/// version.
|
||||
std::string getName(ID id, ArrayRef<Type*> Tys);
|
||||
|
||||
/// Return the function type for an intrinsic.
|
||||
|
|
|
@ -553,6 +553,8 @@ static std::string getMangledTypeStr(Type* Ty) {
|
|||
|
||||
StringRef Intrinsic::getName(ID id) {
|
||||
assert(id < num_intrinsics && "Invalid intrinsic ID!");
|
||||
assert(!isOverloaded(id) &&
|
||||
"This version of getName does not support overloading");
|
||||
return IntrinsicNameTable[id];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue