aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-06-02 14:40:54 +0200
committerMatt Arsenault <arsenm2@gmail.com>2025-06-03 14:55:02 +0900
commit52efdd8cb4cda57363a5bf868cae7ca82bd04513 (patch)
tree85921ff6a93b9e92fab8a46a2686f978e2537043
parenta7ad6b4edf819a8370e44c43629d3742d73378ea (diff)
downloadllvm-users/arsenm/llvm-tli-checker/print-custom-name.zip
llvm-users/arsenm/llvm-tli-checker/print-custom-name.tar.gz
llvm-users/arsenm/llvm-tli-checker/print-custom-name.tar.bz2
llvm-tli-checker: Print custom name instead of standard nameusers/arsenm/llvm-tli-checker/print-custom-name
Previously this always printed the standard name if the function was available, leaving any custom name override untested. Print the target's name instead. The message should possibly include the standard name for reference.
-rw-r--r--llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test4
-rw-r--r--llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test4
-rw-r--r--llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test4
-rw-r--r--llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test10
-rw-r--r--llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp16
5 files changed, 24 insertions, 14 deletions
diff --git a/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test b/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test
index 1878911..018ec13 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/arm64_32-apple-watchos.test
@@ -229,8 +229,8 @@ CHECK-NEXT: available: 'execve'
CHECK-NEXT: available: 'execvp'
CHECK-NEXT: available: 'execvpe'
CHECK-NEXT: available: 'exp'
-CHECK-NEXT: available: 'exp10'
-CHECK-NEXT: available: 'exp10f'
+CHECK-NEXT: available: '__exp10'
+CHECK-NEXT: available: '__exp10f'
CHECK-NEXT: not available: 'exp10l'
CHECK-NEXT: available: 'exp2'
CHECK-NEXT: available: 'exp2f'
diff --git a/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test b/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test
index 03cb8c6..71b731f 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/armv7s-apple-ios7.0.test
@@ -229,8 +229,8 @@ CHECK-NEXT: available: 'execve'
CHECK-NEXT: available: 'execvp'
CHECK-NEXT: available: 'execvpe'
CHECK-NEXT: available: 'exp'
-CHECK-NEXT: available: 'exp10'
-CHECK-NEXT: available: 'exp10f'
+CHECK-NEXT: available: '__exp10'
+CHECK-NEXT: available: '__exp10f'
CHECK-NEXT: not available: 'exp10l'
CHECK-NEXT: available: 'exp2'
CHECK-NEXT: available: 'exp2f'
diff --git a/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test b/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test
index cb7b0b17..cfeba5f 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/i386-apple-macosx10.7.0.test
@@ -286,7 +286,7 @@ CHECK-NEXT: available: 'fork'
CHECK-NEXT: available: 'fprintf'
CHECK-NEXT: available: 'fputc'
CHECK-NEXT: not available: 'fputc_unlocked'
-CHECK-NEXT: available: 'fputs'
+CHECK-NEXT: available: 'fputs$UNIX2003'
CHECK-NEXT: not available: 'fputs_unlocked'
CHECK-NEXT: available: 'fread'
CHECK-NEXT: not available: 'fread_unlocked'
@@ -308,7 +308,7 @@ CHECK-NEXT: available: 'ftello'
CHECK-NEXT: not available: 'ftello64'
CHECK-NEXT: available: 'ftrylockfile'
CHECK-NEXT: available: 'funlockfile'
-CHECK-NEXT: available: 'fwrite'
+CHECK-NEXT: available: 'fwrite$UNIX2003'
CHECK-NEXT: not available: 'fwrite_unlocked'
CHECK-NEXT: available: 'getc'
CHECK-NEXT: available: 'getc_unlocked'
diff --git a/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test b/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test
index 2653cba..5ebbbd7 100644
--- a/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test
+++ b/llvm/test/Analysis/TargetLibraryInfo/x86_64-pc-windows-msvc17.test
@@ -190,7 +190,7 @@ CHECK-NEXT: available: 'atoll'
CHECK-NEXT: not available: 'bcmp'
CHECK-NEXT: not available: 'bcopy'
CHECK-NEXT: not available: 'bzero'
-CHECK-NEXT: available: 'cabs'
+CHECK-NEXT: available: '_cabs'
CHECK-NEXT: not available: 'cabsf'
CHECK-NEXT: not available: 'cabsl'
CHECK-NEXT: available: 'calloc'
@@ -204,8 +204,8 @@ CHECK-NEXT: not available: 'chmod'
CHECK-NEXT: not available: 'chown'
CHECK-NEXT: available: 'clearerr'
CHECK-NEXT: not available: 'closedir'
-CHECK-NEXT: available: 'copysign'
-CHECK-NEXT: available: 'copysignf'
+CHECK-NEXT: available: '_copysign'
+CHECK-NEXT: available: '_copysignf'
CHECK-NEXT: not available: 'copysignl'
CHECK-NEXT: available: 'cos'
CHECK-NEXT: available: 'cosf'
@@ -347,8 +347,8 @@ CHECK-NEXT: not available: 'log2l'
CHECK-NEXT: not available: 'ilogb'
CHECK-NEXT: not available: 'ilogbf'
CHECK-NEXT: not available: 'ilogbl'
-CHECK-NEXT: available: 'logb'
-CHECK-NEXT: available: 'logbf'
+CHECK-NEXT: available: '_logb'
+CHECK-NEXT: available: '_logbf'
CHECK-NEXT: not available: 'logbl'
CHECK-NEXT: available: 'logf'
CHECK-NEXT: not available: 'logl'
diff --git a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
index bc20386..725fe71 100644
--- a/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
+++ b/llvm/tools/llvm-tli-checker/llvm-tli-checker.cpp
@@ -131,10 +131,20 @@ static void dumpTLIEntries(const TargetLibraryInfo &TLI) {
for (unsigned FI = 0; FI != LibFunc::NumLibFuncs; ++FI) {
LibFunc LF = static_cast<LibFunc>(FI);
bool IsAvailable = TLI.has(LF);
- StringRef FuncName = TargetLibraryInfo::getStandardName(LF);
- outs() << (IsAvailable ? " " : "not ")
- << "available: " << getPrintableName(FuncName) << '\n';
+ outs() << (IsAvailable ? " " : "not ") << "available: ";
+
+ if (IsAvailable) {
+ StringRef Name = TLI.getName(LF);
+ // If there is a custom name, print it.
+ // TODO: Should we include the standard name in the printed line?
+ outs() << getPrintableName(Name);
+ } else {
+ // If it's not available, refer to it by the standard name.
+ outs() << getPrintableName(TargetLibraryInfo::getStandardName(LF));
+ }
+
+ outs() << '\n';
}
}