[PATCH] D56567: [ADT] Force attribute used on functions marked as always_inline.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 10 15:56:55 PST 2019


davide created this revision.
davide added reviewers: aprantl, mehdi_amini, chandlerc, friss.
Herald added a subscriber: dexonsmith.

If the functions are always inlined, the compiler is not forced
to emit their body, so the debugger can't evaluate them.

e.g.

$1 = (StringRef) "patatino"
(lldb) expr $1.size()
error: Couldn't lookup symbols:

__attribute__((used)) forces the symbols to be emitted even if
they're not referenced. An alternatve proposed was that of
dropping always_inline entirely from LLVM, as it should be
used exclusively where not inlining a function causes correctness
issues. Some concerns have been raised about tblgen being too
slow without the annotations.


https://reviews.llvm.org/D56567

Files:
  llvm/include/llvm/ADT/SmallVector.h
  llvm/include/llvm/ADT/StringRef.h
  llvm/include/llvm/ADT/StringSwitch.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56567.181179.patch
Type: text/x-patch
Size: 18745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190110/2f80a4b3/attachment.bin>


More information about the llvm-commits mailing list