[PATCH] D65790: [TableGen] FieldInit: improve assertion message

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 10:04:46 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL368060: [TableGen] FieldInit: improve assertion message (authored by lebedevri, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D65790?vs=213533&id=213648#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D65790

Files:
  llvm/trunk/include/llvm/TableGen/Record.h


Index: llvm/trunk/include/llvm/TableGen/Record.h
===================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h
+++ llvm/trunk/include/llvm/TableGen/Record.h
@@ -1263,7 +1263,14 @@
 
   FieldInit(Init *R, StringInit *FN)
       : TypedInit(IK_FieldInit, R->getFieldType(FN)), Rec(R), FieldName(FN) {
-    assert(getType() && "FieldInit with non-record type!");
+#ifndef NDEBUG
+    if (!getType()) {
+      llvm::errs() << "In Record = " << Rec->getAsString()
+                   << ", got FieldName = " << *FieldName
+                   << " with non-record type!\n";
+      llvm_unreachable("FieldInit with non-record type!");
+    }
+#endif
   }
 
 public:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65790.213648.patch
Type: text/x-patch
Size: 711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190806/51d4ae77/attachment.bin>


More information about the llvm-commits mailing list