llvm.org GIT mirror llvm / a0b5a74
AsmPrinter: Cleanup DIEValue::EmitValue() API, NFC Stop taking a `dwarf::Form` in `DIEValue::EmitValue()` and `DIEValue::SizeOf()`, since they're always passed `DIEValue::getForm()` anyway. This is just left over from when `DIEValue` didn't know its own form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240566 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 5 years ago
4 changed file(s) with 15 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
435435
436436 /// EmitValue - Emit value via the Dwarf writer.
437437 ///
438 void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const;
438 void EmitValue(const AsmPrinter *AP) const;
439439
440440 /// SizeOf - Return the size of a value in bytes.
441441 ///
442 unsigned SizeOf(const AsmPrinter *AP, dwarf::Form Form) const;
442 unsigned SizeOf(const AsmPrinter *AP) const;
443443
444444 #ifndef NDEBUG
445445 void print(raw_ostream &O) const;
260260 // Emit the DIE attribute values.
261261 for (const auto &V : Die.values()) {
262262 dwarf::Attribute Attr = V.getAttribute();
263 dwarf::Form Form = V.getForm();
264 assert(Form && "Too many attributes for DIE (check abbreviation)");
263 assert(V.getForm() && "Too many attributes for DIE (check abbreviation)");
265264
266265 if (isVerbose()) {
267266 OutStreamer->AddComment(dwarf::AttributeString(Attr));
271270 }
272271
273272 // Emit an attribute using the defined form.
274 V.EmitValue(this, Form);
273 V.EmitValue(this);
275274 }
276275
277276 // Emit the DIE children if any.
192192 }
193193 #endif
194194
195 void DIEValue::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
195 void DIEValue::EmitValue(const AsmPrinter *AP) const {
196196 switch (Ty) {
197197 case isNone:
198198 llvm_unreachable("Expected valid DIEValue");
204204 }
205205 }
206206
207 unsigned DIEValue::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
207 unsigned DIEValue::SizeOf(const AsmPrinter *AP) const {
208208 switch (Ty) {
209209 case isNone:
210210 llvm_unreachable("Expected valid DIEValue");
506506 ///
507507 unsigned DIELoc::ComputeSize(const AsmPrinter *AP) const {
508508 if (!Size) {
509 for (unsigned i = 0, N = Values.size(); i < N; ++i)
510 Size += Values[i].SizeOf(AP, Values[i].getForm());
509 for (const auto &V : Values)
510 Size += V.SizeOf(AP);
511511 }
512512
513513 return Size;
526526 Asm->EmitULEB128(Size); break;
527527 }
528528
529 for (unsigned i = 0, N = Values.size(); i < N; ++i)
530 Values[i].EmitValue(Asm, Values[i].getForm());
529 for (const auto &V : Values)
530 V.EmitValue(Asm);
531531 }
532532
533533 /// SizeOf - Determine size of location data in bytes.
559559 ///
560560 unsigned DIEBlock::ComputeSize(const AsmPrinter *AP) const {
561561 if (!Size) {
562 for (unsigned i = 0, N = Values.size(); i < N; ++i)
563 Size += Values[i].SizeOf(AP, Values[i].getForm());
562 for (const auto &V : Values)
563 Size += V.SizeOf(AP);
564564 }
565565
566566 return Size;
577577 case dwarf::DW_FORM_block: Asm->EmitULEB128(Size); break;
578578 }
579579
580 for (unsigned i = 0, N = Values.size(); i < N; ++i)
581 Values[i].EmitValue(Asm, Values[i].getForm());
580 for (const auto &V : Values)
581 V.EmitValue(Asm);
582582 }
583583
584584 /// SizeOf - Determine size of block data in bytes.
102102 // Size the DIE attribute values.
103103 for (const auto &V : Die.values())
104104 // Size attribute value.
105 Offset += V.SizeOf(Asm, V.getForm());
105 Offset += V.SizeOf(Asm);
106106
107107 // Size the DIE children if any.
108108 if (Die.hasChildren()) {