[PATCH] D65429: Improving CodeView debug info type record's inline comments

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 16:41:34 PDT 2019


rnk added a comment.

The code feels very std::string-y now. :) I see two places where StringRef should work and would be more consistent with the rest of LLVM, but other than that I would leave it as you have it.



================
Comment at: llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp:27
+
+static std::string getLeafTypeName(TypeLeafKind LT) {
+  switch (LT) {
----------------
I don't think this needs to return `std::string`, it only return string literals, which live forever.


================
Comment at: llvm/lib/DebugInfo/CodeView/TypeRecordMapping.cpp:82
+template <typename T, typename TEnum>
+static std::string getEnumName(CodeViewRecordIO &IO, T Value,
+                               ArrayRef<EnumEntry<TEnum>> EnumValues) {
----------------
I don't think this needs to return `std::string`, since it only ever returns constant strings from tables or the empty string.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65429





More information about the llvm-commits mailing list