[PATCH] D20480: pdbdump: print out symbol names referred by publics stream.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 15:53:38 PDT 2016


On Fri, May 20, 2016 at 3:43 PM, David Majnemer <david.majnemer at gmail.com>
wrote:

> majnemer added a subscriber: majnemer.
>
> ================
> Comment at: lib/DebugInfo/PDB/Raw/SymbolStream.cpp:57
> @@ +56,3 @@
> +
> +static StringRef makeStringRef(char *p) { return {p, strlen(p)}; }
> +
> ----------------
> Why not make this `const char *` ?  Then you could use the implicit
> constructor to make a `StringRef`.
>

Or, we can return `reinterpret_cast<DataSym32 *>(Buf.data())->name` from
`getSymbolName`.

(I originally thought that StringRef might have a constructor `template
<size_t N> StringRef(const char (&Str)[N])` to avoid computing the length
of a fixed size string at runtime, but seems that it doesn't have such
constructor, so it should work.)

Also, variable names should be capitalized.
>
>
> Repository:
>   rL LLVM
>
> http://reviews.llvm.org/D20480
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160520/dd626bbc/attachment.html>


More information about the llvm-commits mailing list