llvm.org GIT mirror llvm / 5d71d87
PR19554: Fix some memory leaks in DIEHashTest.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207240 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 6 years ago
1 changed file(s) with 13 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
566566 DIEInteger Four(4);
567567 DIEInteger Five(5);
568568 DIEString FStr(&One, "int");
569 DIE *IntTyDIE = new DIE(dwarf::DW_TAG_base_type);
570 IntTyDIE->addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Four);
571 IntTyDIE->addValue(dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, &Five);
572 IntTyDIE->addValue(dwarf::DW_AT_name, dwarf::DW_FORM_strp, &FStr);
573
574 DIEEntry IntTy(IntTyDIE);
569 DIE IntTyDIE(dwarf::DW_TAG_base_type);
570 IntTyDIE.addValue(dwarf::DW_AT_byte_size, dwarf::DW_FORM_data1, &Four);
571 IntTyDIE.addValue(dwarf::DW_AT_encoding, dwarf::DW_FORM_data1, &Five);
572 IntTyDIE.addValue(dwarf::DW_AT_name, dwarf::DW_FORM_strp, &FStr);
573
574 DIEEntry IntTy(&IntTyDIE);
575575 DIE *PITyDIE = new DIE(dwarf::DW_TAG_const_type);
576576 PITyDIE->addValue(dwarf::DW_AT_type, dwarf::DW_FORM_ref4, &IntTy);
577577
630630 PI->addValue(dwarf::DW_AT_external, dwarf::DW_FORM_flag_present, &One);
631631 PI->addValue(dwarf::DW_AT_declaration, dwarf::DW_FORM_flag_present, &One);
632632
633 DIEBlock *PIBlock = new DIEBlock();
633 DIEBlock PIBlock;
634634 DIEInteger Blk1(0xc3);
635635 DIEInteger Blk2(0xf5);
636636 DIEInteger Blk3(0x48);
637637 DIEInteger Blk4(0x40);
638638
639 PIBlock->addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk1);
640 PIBlock->addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk2);
641 PIBlock->addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk3);
642 PIBlock->addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk4);
643
644 PI->addValue(dwarf::DW_AT_const_value, dwarf::DW_FORM_block1, PIBlock);
639 PIBlock.addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk1);
640 PIBlock.addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk2);
641 PIBlock.addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk3);
642 PIBlock.addValue((dwarf::Attribute)0, dwarf::DW_FORM_data1, &Blk4);
643
644 PI->addValue(dwarf::DW_AT_const_value, dwarf::DW_FORM_block1, &PIBlock);
645645
646646 A.addChild(PI);
647647