When there are multiple instances of a forward decl record type, only the first one is emitted with a type index, because
the type is added to a map with a null type index. Avoid this by reordering so that forward decl types aren't added to the map.
Details
Details
- Reviewers
- rnk 
- Commits
- rZORGecb100f50c58: Fix bug in getCompleteTypeIndex in codeview debug info
 rZORG1479028ac17b: Fix bug in getCompleteTypeIndex in codeview debug info
 rGecb100f50c58: Fix bug in getCompleteTypeIndex in codeview debug info
 rG1479028ac17b: Fix bug in getCompleteTypeIndex in codeview debug info
 rG987b969babe1: Fix bug in getCompleteTypeIndex in codeview debug info
 rL360101: Fix bug in getCompleteTypeIndex in codeview debug info
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
This should have a test. I think you can use this C++ to start:
struct Foo;
extern "C" __declspec(allocator) Foo *alloc_foo();
void escape(Foo*);
void doit() {
  escape(alloc_foo());
  escape(alloc_foo());
  escape(alloc_foo());
}Before this change, the symbols would show the wrong type for the second and third heap alloc sites.
| llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | ||
|---|---|---|
| 2519–2521 ↗ | (On Diff #197855) | While we're here, please simplify this to just use .find since we can't use InsertResult below. | 
| 2536–2539 ↗ | (On Diff #197855) | If you do delete InsertResult, you should simplify this comment to just say that we need to re-do the hash lookup because complete type lowering may insert more complete types into the table. | 
Comment Actions
- Add comment about inserting type to map
| llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | ||
|---|---|---|
| 2519–2521 ↗ | (On Diff #197855) | Not inserting breaks in the case of circular references |