[PATCH] D27775: [ThinLTO] Import composite types as declarations

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 3 09:15:00 PST 2017


aprantl added inline comments.


================
Comment at: llvm/trunk/lib/Bitcode/Reader/MetadataLoader.cpp:750
+        TemplateParams = getMDOrNull(Record[14]);
+      }
       DICompositeType *CT = nullptr;
----------------
Sorry for bringing this up so late, but I just realized that this is only legal if the `Identifier` field is nonempty. The ODR (or an equivalent rule in the underlying source language) only applies to types with an identifier field. In C, for example, it is legal for multiple translation units to contain definitions of types with the same name, but a different layout. Using just the name it is impossible for the debugger to find the correct definition of a forward-declared type in the other translation units.


Repository:
  rL LLVM

https://reviews.llvm.org/D27775





More information about the llvm-commits mailing list