[llvm-branch-commits] [llvm-branch] r352546 - Merging r351910:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Jan 29 13:21:15 PST 2019


Author: hans
Date: Tue Jan 29 13:21:14 2019
New Revision: 352546

URL: http://llvm.org/viewvc/llvm-project?rev=352546&view=rev
Log:
Merging r351910:
------------------------------------------------------------------------
r351910 | cuviper | 2019-01-23 01:53:22 +0100 (Wed, 23 Jan 2019) | 18 lines

[CodeView] Allow empty types in member functions

Summary:
`CodeViewDebug::lowerTypeMemberFunction` used to default to a `Void`
return type if the function's type array was empty. After D54667, it
started blindly indexing the 0th item for the return type, which fails
in `getOperand` for empty arrays if assertions are enabled.

This patch restores the `Void` return type for empty type arrays, and
adds a test generated by Rust in line-only debuginfo mode.

Reviewers: zturner, rnk

Reviewed By: rnk

Subscribers: hiraditya, JDevlieghere, llvm-commits

Differential Revision: https://reviews.llvm.org/D57070
------------------------------------------------------------------------

Added:
    llvm/branches/release_80/test/DebugInfo/COFF/types-empty-member-fn.ll
      - copied unchanged from r351910, llvm/trunk/test/DebugInfo/COFF/types-empty-member-fn.ll
Modified:
    llvm/branches/release_80/   (props changed)
    llvm/branches/release_80/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

Propchange: llvm/branches/release_80/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 29 13:21:14 2019
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351930,351932,352034,352204,352374
+/llvm/trunk:155241,351325,351344-351345,351349,351351,351370,351381,351421,351426,351436,351475,351485,351753-351754,351910,351930,351932,352034,352204,352374

Modified: llvm/branches/release_80/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_80/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp?rev=352546&r1=352545&r2=352546&view=diff
==============================================================================
--- llvm/branches/release_80/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp (original)
+++ llvm/branches/release_80/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp Tue Jan 29 13:21:14 2019
@@ -1836,7 +1836,10 @@ TypeIndex CodeViewDebug::lowerTypeMember
 
   unsigned Index = 0;
   SmallVector<TypeIndex, 8> ArgTypeIndices;
-  TypeIndex ReturnTypeIndex = getTypeIndex(ReturnAndArgs[Index++]);
+  TypeIndex ReturnTypeIndex = TypeIndex::Void();
+  if (ReturnAndArgs.size() > Index) {
+    ReturnTypeIndex = getTypeIndex(ReturnAndArgs[Index++]);
+  }
 
   // If the first argument is a pointer type and this isn't a static method,
   // treat it as the special 'this' parameter, which is encoded separately from




More information about the llvm-branch-commits mailing list