aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-01-05 17:44:11 +0000
committerDevang Patel <dpatel@apple.com>2009-01-05 17:44:11 +0000
commit9ede3f2f29a44f7b4a46eb453a7fa61985b99cdb (patch)
treef9f5a93b93b890fe7bc3b5d4ffac93ed3c00d8c9 /lib/CodeGen/AsmPrinter/DwarfWriter.cpp
parent105a91a3fa09ea99f62bf46533579d6b1156128d (diff)
subsume ConstructBasicType().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DwarfWriter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfWriter.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index 691c922d0a..3b21cebe44 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
@@ -1437,20 +1437,13 @@ private:
void AddBasicType(DIE *Entity, CompileUnit *Unit,
const std::string &Name,
unsigned Encoding, unsigned Size) {
- DIE *Die = ConstructBasicType(Unit, Name, Encoding, Size);
- AddDIEntry(Entity, DW_AT_type, DW_FORM_ref4, Die);
- }
- /// ConstructBasicType - Construct a new basic type.
- ///
- DIE *ConstructBasicType(CompileUnit *Unit,
- const std::string &Name,
- unsigned Encoding, unsigned Size) {
DIE Buffer(DW_TAG_base_type);
AddUInt(&Buffer, DW_AT_byte_size, 0, Size);
AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, Encoding);
if (!Name.empty()) AddString(&Buffer, DW_AT_name, DW_FORM_string, Name);
- return Unit->AddDie(Buffer);
+ DIE *BasicTypeDie = Unit->AddDie(Buffer);
+ AddDIEntry(Entity, DW_AT_type, DW_FORM_ref4, BasicTypeDie);
}
/// AddPointerType - Add a new pointer type attribute to the specified entity.
@@ -1555,8 +1548,10 @@ private:
Size = 0;
// Construct an anonymous type for index type.
- DIE *IndexTy = ConstructBasicType(Unit, "", DW_ATE_signed,
- sizeof(int32_t));
+ DIE Buffer(DW_TAG_base_type);
+ AddUInt(&Buffer, DW_AT_byte_size, 0, sizeof(int32_t));
+ AddUInt(&Buffer, DW_AT_encoding, DW_FORM_data1, DW_ATE_signed);
+ DIE *IndexTy = Unit->AddDie(Buffer);
// Add subranges to array type.
for (unsigned i = 0, N = Elements.size(); i < N; ++i) {