[PATCH] D157951: [NFC][TLI] Replace std::lower_bound call in getLibFunc with DenseMap lookup

Dhruv Chawla via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 05:26:49 PDT 2023


0xdc03 marked 2 inline comments as done.
0xdc03 added inline comments.


================
Comment at: llvm/lib/Analysis/TargetLibraryInfo.cpp:945
+static DenseMap<StringRef, unsigned>
+buildIndexMap(const StringLiteral (&StandardNames)[LibFunc::NumLibFuncs]) {
+  DenseMap<StringRef, unsigned> Indices;
----------------
nikic wrote:
> StandardNames is a global variable in this file, no need to pass it as an argument.
Unfortunately not:
```
error: 'StandardNames' is a private member of 'llvm::TargetLibraryInfoImpl'
  for (const auto &Func : TargetLibraryInfoImpl::StandardNames)
                                                 ^
```
I could make `buildIndexMap` a member of `TargetLibraryInfoImpl`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157951/new/

https://reviews.llvm.org/D157951



More information about the llvm-commits mailing list