summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-04-10 14:23:41 +0000
committerPavel Labath <labath@google.com>2018-04-10 14:23:41 +0000
commitb7243ed2f406a30625c365e8e7ed04827dd3ee95 (patch)
tree36ff886981837e5fad8c4e21ac9ae2191c7cb5c7 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
parent95f941117cf25787598d01f9943c9a9713cd4b92 (diff)
downloadbcm5719-llvm-b7243ed2f406a30625c365e8e7ed04827dd3ee95.tar.gz
bcm5719-llvm-b7243ed2f406a30625c365e8e7ed04827dd3ee95.zip
[CodeGen/Dwarf] Rename the "sizetype" synthetic type and add it to the accelerator table
Summary: This type is created on-demand and used as the base type for array ranges. Since it is "special", its construction did not go through the createTypeDIE function and so it was never inserted into the accelerator table, although it clearly belongs there. I add an explicit addAccelType call to insert it into the table. During review, we also decided to rename the type to something more unique to avoid confusion in case the user has own "sizetype" type. The new name for the type size __ARRAY_SIZE_TYPE__. Reviewers: JDevlieghere, aprantl, dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D45445 llvm-svn: 329705
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index ae1f49f98f8..77861ad45be 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -1404,10 +1404,12 @@ DIE *DwarfUnit::getIndexTyDie() {
return IndexTyDie;
// Construct an integer type to use for indexes.
IndexTyDie = &createAndAddDIE(dwarf::DW_TAG_base_type, getUnitDie());
- addString(*IndexTyDie, dwarf::DW_AT_name, "sizetype");
+ StringRef Name = "__ARRAY_SIZE_TYPE__";
+ addString(*IndexTyDie, dwarf::DW_AT_name, Name);
addUInt(*IndexTyDie, dwarf::DW_AT_byte_size, None, sizeof(int64_t));
addUInt(*IndexTyDie, dwarf::DW_AT_encoding, dwarf::DW_FORM_data1,
dwarf::DW_ATE_unsigned);
+ DD->addAccelType(Name, *IndexTyDie, /*Flags*/ 0);
return IndexTyDie;
}
OpenPOWER on IntegriCloud