Add a TargetMachine hook that verifies DataLayout compatibility
[oota-llvm.git] / lib / CodeGen / AsmPrinter / DIE.cpp
1 //===--- lib/CodeGen/DIE.cpp - DWARF Info Entries -------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Data structures for DWARF info entries.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "llvm/CodeGen/DIE.h"
15 #include "DwarfCompileUnit.h"
16 #include "DwarfDebug.h"
17 #include "DwarfUnit.h"
18 #include "llvm/ADT/Twine.h"
19 #include "llvm/CodeGen/AsmPrinter.h"
20 #include "llvm/IR/DataLayout.h"
21 #include "llvm/MC/MCAsmInfo.h"
22 #include "llvm/MC/MCContext.h"
23 #include "llvm/MC/MCStreamer.h"
24 #include "llvm/MC/MCSymbol.h"
25 #include "llvm/Support/Debug.h"
26 #include "llvm/Support/ErrorHandling.h"
27 #include "llvm/Support/Format.h"
28 #include "llvm/Support/FormattedStream.h"
29 #include "llvm/Support/LEB128.h"
30 #include "llvm/Support/MD5.h"
31 #include "llvm/Support/raw_ostream.h"
32 using namespace llvm;
33
34 //===----------------------------------------------------------------------===//
35 // DIEAbbrevData Implementation
36 //===----------------------------------------------------------------------===//
37
38 /// Profile - Used to gather unique data for the abbreviation folding set.
39 ///
40 void DIEAbbrevData::Profile(FoldingSetNodeID &ID) const {
41   // Explicitly cast to an integer type for which FoldingSetNodeID has
42   // overloads.  Otherwise MSVC 2010 thinks this call is ambiguous.
43   ID.AddInteger(unsigned(Attribute));
44   ID.AddInteger(unsigned(Form));
45 }
46
47 //===----------------------------------------------------------------------===//
48 // DIEAbbrev Implementation
49 //===----------------------------------------------------------------------===//
50
51 /// Profile - Used to gather unique data for the abbreviation folding set.
52 ///
53 void DIEAbbrev::Profile(FoldingSetNodeID &ID) const {
54   ID.AddInteger(unsigned(Tag));
55   ID.AddInteger(unsigned(Children));
56
57   // For each attribute description.
58   for (unsigned i = 0, N = Data.size(); i < N; ++i)
59     Data[i].Profile(ID);
60 }
61
62 /// Emit - Print the abbreviation using the specified asm printer.
63 ///
64 void DIEAbbrev::Emit(const AsmPrinter *AP) const {
65   // Emit its Dwarf tag type.
66   AP->EmitULEB128(Tag, dwarf::TagString(Tag));
67
68   // Emit whether it has children DIEs.
69   AP->EmitULEB128((unsigned)Children, dwarf::ChildrenString(Children));
70
71   // For each attribute description.
72   for (unsigned i = 0, N = Data.size(); i < N; ++i) {
73     const DIEAbbrevData &AttrData = Data[i];
74
75     // Emit attribute type.
76     AP->EmitULEB128(AttrData.getAttribute(),
77                     dwarf::AttributeString(AttrData.getAttribute()));
78
79     // Emit form type.
80     AP->EmitULEB128(AttrData.getForm(),
81                     dwarf::FormEncodingString(AttrData.getForm()));
82   }
83
84   // Mark end of abbreviation.
85   AP->EmitULEB128(0, "EOM(1)");
86   AP->EmitULEB128(0, "EOM(2)");
87 }
88
89 #ifndef NDEBUG
90 void DIEAbbrev::print(raw_ostream &O) {
91   O << "Abbreviation @"
92     << format("0x%lx", (long)(intptr_t)this)
93     << "  "
94     << dwarf::TagString(Tag)
95     << " "
96     << dwarf::ChildrenString(Children)
97     << '\n';
98
99   for (unsigned i = 0, N = Data.size(); i < N; ++i) {
100     O << "  "
101       << dwarf::AttributeString(Data[i].getAttribute())
102       << "  "
103       << dwarf::FormEncodingString(Data[i].getForm())
104       << '\n';
105   }
106 }
107 void DIEAbbrev::dump() { print(dbgs()); }
108 #endif
109
110 DIEAbbrev DIE::generateAbbrev() const {
111   DIEAbbrev Abbrev(Tag, hasChildren());
112   for (const DIEValue &V : Values)
113     Abbrev.AddAttribute(V.getAttribute(), V.getForm());
114   return Abbrev;
115 }
116
117 /// Climb up the parent chain to get the unit DIE to which this DIE
118 /// belongs.
119 const DIE *DIE::getUnit() const {
120   const DIE *Cu = getUnitOrNull();
121   assert(Cu && "We should not have orphaned DIEs.");
122   return Cu;
123 }
124
125 /// Climb up the parent chain to get the unit DIE this DIE belongs
126 /// to. Return NULL if DIE is not added to an owner yet.
127 const DIE *DIE::getUnitOrNull() const {
128   const DIE *p = this;
129   while (p) {
130     if (p->getTag() == dwarf::DW_TAG_compile_unit ||
131         p->getTag() == dwarf::DW_TAG_type_unit)
132       return p;
133     p = p->getParent();
134   }
135   return nullptr;
136 }
137
138 DIEValue DIE::findAttribute(dwarf::Attribute Attribute) const {
139   // Iterate through all the attributes until we find the one we're
140   // looking for, if we can't find it return NULL.
141   for (const auto &V : values())
142     if (V.getAttribute() == Attribute)
143       return V;
144   return DIEValue();
145 }
146
147 #ifndef NDEBUG
148 void DIE::print(raw_ostream &O, unsigned IndentCount) const {
149   const std::string Indent(IndentCount, ' ');
150   bool isBlock = getTag() == 0;
151
152   if (!isBlock) {
153     O << Indent
154       << "Die: "
155       << format("0x%lx", (long)(intptr_t)this)
156       << ", Offset: " << Offset
157       << ", Size: " << Size << "\n";
158
159     O << Indent
160       << dwarf::TagString(getTag())
161       << " "
162       << dwarf::ChildrenString(hasChildren()) << "\n";
163   } else {
164     O << "Size: " << Size << "\n";
165   }
166
167   IndentCount += 2;
168   unsigned I = 0;
169   for (const auto &V : Values) {
170     O << Indent;
171
172     if (!isBlock)
173       O << dwarf::AttributeString(V.getAttribute());
174     else
175       O << "Blk[" << I++ << "]";
176
177     O << "  " << dwarf::FormEncodingString(V.getForm()) << " ";
178     V.print(O);
179     O << "\n";
180   }
181   IndentCount -= 2;
182
183   for (const auto &Child : children())
184     Child.print(O, IndentCount + 4);
185
186   if (!isBlock) O << "\n";
187 }
188
189 void DIE::dump() {
190   print(dbgs());
191 }
192 #endif
193
194 void DIEValue::EmitValue(const AsmPrinter *AP) const {
195   switch (Ty) {
196   case isNone:
197     llvm_unreachable("Expected valid DIEValue");
198 #define HANDLE_DIEVALUE(T)                                                     \
199   case is##T:                                                                  \
200     getDIE##T().EmitValue(AP, Form);                                           \
201     break;
202 #include "llvm/CodeGen/DIEValue.def"
203   }
204 }
205
206 unsigned DIEValue::SizeOf(const AsmPrinter *AP) const {
207   switch (Ty) {
208   case isNone:
209     llvm_unreachable("Expected valid DIEValue");
210 #define HANDLE_DIEVALUE(T)                                                     \
211   case is##T:                                                                  \
212     return getDIE##T().SizeOf(AP, Form);
213 #include "llvm/CodeGen/DIEValue.def"
214   }
215   llvm_unreachable("Unknown DIE kind");
216 }
217
218 #ifndef NDEBUG
219 void DIEValue::print(raw_ostream &O) const {
220   switch (Ty) {
221   case isNone:
222     llvm_unreachable("Expected valid DIEValue");
223 #define HANDLE_DIEVALUE(T)                                                     \
224   case is##T:                                                                  \
225     getDIE##T().print(O);                                                      \
226     break;
227 #include "llvm/CodeGen/DIEValue.def"
228   }
229 }
230
231 void DIEValue::dump() const {
232   print(dbgs());
233 }
234 #endif
235
236 //===----------------------------------------------------------------------===//
237 // DIEInteger Implementation
238 //===----------------------------------------------------------------------===//
239
240 /// EmitValue - Emit integer of appropriate size.
241 ///
242 void DIEInteger::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
243   unsigned Size = ~0U;
244   switch (Form) {
245   case dwarf::DW_FORM_flag_present:
246     // Emit something to keep the lines and comments in sync.
247     // FIXME: Is there a better way to do this?
248     Asm->OutStreamer->AddBlankLine();
249     return;
250   case dwarf::DW_FORM_flag:  // Fall thru
251   case dwarf::DW_FORM_ref1:  // Fall thru
252   case dwarf::DW_FORM_data1: Size = 1; break;
253   case dwarf::DW_FORM_ref2:  // Fall thru
254   case dwarf::DW_FORM_data2: Size = 2; break;
255   case dwarf::DW_FORM_sec_offset: // Fall thru
256   case dwarf::DW_FORM_strp: // Fall thru
257   case dwarf::DW_FORM_ref4:  // Fall thru
258   case dwarf::DW_FORM_data4: Size = 4; break;
259   case dwarf::DW_FORM_ref8:  // Fall thru
260   case dwarf::DW_FORM_ref_sig8:  // Fall thru
261   case dwarf::DW_FORM_data8: Size = 8; break;
262   case dwarf::DW_FORM_GNU_str_index: Asm->EmitULEB128(Integer); return;
263   case dwarf::DW_FORM_GNU_addr_index: Asm->EmitULEB128(Integer); return;
264   case dwarf::DW_FORM_udata: Asm->EmitULEB128(Integer); return;
265   case dwarf::DW_FORM_sdata: Asm->EmitSLEB128(Integer); return;
266   case dwarf::DW_FORM_addr:
267     Size = Asm->getPointerSize();
268     break;
269   case dwarf::DW_FORM_ref_addr:
270     Size = SizeOf(Asm, dwarf::DW_FORM_ref_addr);
271     break;
272   default: llvm_unreachable("DIE Value form not supported yet");
273   }
274   Asm->OutStreamer->EmitIntValue(Integer, Size);
275 }
276
277 /// SizeOf - Determine size of integer value in bytes.
278 ///
279 unsigned DIEInteger::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
280   switch (Form) {
281   case dwarf::DW_FORM_flag_present: return 0;
282   case dwarf::DW_FORM_flag:  // Fall thru
283   case dwarf::DW_FORM_ref1:  // Fall thru
284   case dwarf::DW_FORM_data1: return sizeof(int8_t);
285   case dwarf::DW_FORM_ref2:  // Fall thru
286   case dwarf::DW_FORM_data2: return sizeof(int16_t);
287   case dwarf::DW_FORM_sec_offset: // Fall thru
288   case dwarf::DW_FORM_strp: // Fall thru
289   case dwarf::DW_FORM_ref4:  // Fall thru
290   case dwarf::DW_FORM_data4: return sizeof(int32_t);
291   case dwarf::DW_FORM_ref8:  // Fall thru
292   case dwarf::DW_FORM_ref_sig8:  // Fall thru
293   case dwarf::DW_FORM_data8: return sizeof(int64_t);
294   case dwarf::DW_FORM_GNU_str_index: return getULEB128Size(Integer);
295   case dwarf::DW_FORM_GNU_addr_index: return getULEB128Size(Integer);
296   case dwarf::DW_FORM_udata: return getULEB128Size(Integer);
297   case dwarf::DW_FORM_sdata: return getSLEB128Size(Integer);
298   case dwarf::DW_FORM_addr:
299     return AP->getPointerSize();
300   case dwarf::DW_FORM_ref_addr:
301     if (AP->OutStreamer->getContext().getDwarfVersion() == 2)
302       return AP->getPointerSize();
303     return sizeof(int32_t);
304   default: llvm_unreachable("DIE Value form not supported yet");
305   }
306 }
307
308 #ifndef NDEBUG
309 void DIEInteger::print(raw_ostream &O) const {
310   O << "Int: " << (int64_t)Integer << "  0x";
311   O.write_hex(Integer);
312 }
313 #endif
314
315 //===----------------------------------------------------------------------===//
316 // DIEExpr Implementation
317 //===----------------------------------------------------------------------===//
318
319 /// EmitValue - Emit expression value.
320 ///
321 void DIEExpr::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
322   AP->OutStreamer->EmitValue(Expr, SizeOf(AP, Form));
323 }
324
325 /// SizeOf - Determine size of expression value in bytes.
326 ///
327 unsigned DIEExpr::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
328   if (Form == dwarf::DW_FORM_data4) return 4;
329   if (Form == dwarf::DW_FORM_sec_offset) return 4;
330   if (Form == dwarf::DW_FORM_strp) return 4;
331   return AP->getPointerSize();
332 }
333
334 #ifndef NDEBUG
335 void DIEExpr::print(raw_ostream &O) const { O << "Expr: " << *Expr; }
336 #endif
337
338 //===----------------------------------------------------------------------===//
339 // DIELabel Implementation
340 //===----------------------------------------------------------------------===//
341
342 /// EmitValue - Emit label value.
343 ///
344 void DIELabel::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
345   AP->EmitLabelReference(Label, SizeOf(AP, Form),
346                          Form == dwarf::DW_FORM_strp ||
347                              Form == dwarf::DW_FORM_sec_offset ||
348                              Form == dwarf::DW_FORM_ref_addr);
349 }
350
351 /// SizeOf - Determine size of label value in bytes.
352 ///
353 unsigned DIELabel::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
354   if (Form == dwarf::DW_FORM_data4) return 4;
355   if (Form == dwarf::DW_FORM_sec_offset) return 4;
356   if (Form == dwarf::DW_FORM_strp) return 4;
357   return AP->getPointerSize();
358 }
359
360 #ifndef NDEBUG
361 void DIELabel::print(raw_ostream &O) const { O << "Lbl: " << Label->getName(); }
362 #endif
363
364 //===----------------------------------------------------------------------===//
365 // DIEDelta Implementation
366 //===----------------------------------------------------------------------===//
367
368 /// EmitValue - Emit delta value.
369 ///
370 void DIEDelta::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
371   AP->EmitLabelDifference(LabelHi, LabelLo, SizeOf(AP, Form));
372 }
373
374 /// SizeOf - Determine size of delta value in bytes.
375 ///
376 unsigned DIEDelta::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
377   if (Form == dwarf::DW_FORM_data4) return 4;
378   if (Form == dwarf::DW_FORM_sec_offset) return 4;
379   if (Form == dwarf::DW_FORM_strp) return 4;
380   return AP->getPointerSize();
381 }
382
383 #ifndef NDEBUG
384 void DIEDelta::print(raw_ostream &O) const {
385   O << "Del: " << LabelHi->getName() << "-" << LabelLo->getName();
386 }
387 #endif
388
389 //===----------------------------------------------------------------------===//
390 // DIEString Implementation
391 //===----------------------------------------------------------------------===//
392
393 /// EmitValue - Emit string value.
394 ///
395 void DIEString::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
396   assert(
397       (Form == dwarf::DW_FORM_strp || Form == dwarf::DW_FORM_GNU_str_index) &&
398       "Expected valid string form");
399
400   // Index of string in symbol table.
401   if (Form == dwarf::DW_FORM_GNU_str_index) {
402     DIEInteger(S.getIndex()).EmitValue(AP, Form);
403     return;
404   }
405
406   // Relocatable symbol.
407   assert(Form == dwarf::DW_FORM_strp);
408   if (AP->MAI->doesDwarfUseRelocationsAcrossSections()) {
409     DIELabel(S.getSymbol()).EmitValue(AP, Form);
410     return;
411   }
412
413   // Offset into symbol table.
414   DIEInteger(S.getOffset()).EmitValue(AP, Form);
415 }
416
417 /// SizeOf - Determine size of delta value in bytes.
418 ///
419 unsigned DIEString::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
420   assert(
421       (Form == dwarf::DW_FORM_strp || Form == dwarf::DW_FORM_GNU_str_index) &&
422       "Expected valid string form");
423
424   // Index of string in symbol table.
425   if (Form == dwarf::DW_FORM_GNU_str_index)
426     return DIEInteger(S.getIndex()).SizeOf(AP, Form);
427
428   // Relocatable symbol.
429   if (AP->MAI->doesDwarfUseRelocationsAcrossSections())
430     return DIELabel(S.getSymbol()).SizeOf(AP, Form);
431
432   // Offset into symbol table.
433   return DIEInteger(S.getOffset()).SizeOf(AP, Form);
434 }
435
436 #ifndef NDEBUG
437 void DIEString::print(raw_ostream &O) const {
438   O << "String: " << S.getString();
439 }
440 #endif
441
442 //===----------------------------------------------------------------------===//
443 // DIEEntry Implementation
444 //===----------------------------------------------------------------------===//
445
446 /// EmitValue - Emit debug information entry offset.
447 ///
448 void DIEEntry::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
449
450   if (Form == dwarf::DW_FORM_ref_addr) {
451     const DwarfDebug *DD = AP->getDwarfDebug();
452     unsigned Addr = Entry->getOffset();
453     assert(!DD->useSplitDwarf() && "TODO: dwo files can't have relocations.");
454     // For DW_FORM_ref_addr, output the offset from beginning of debug info
455     // section. Entry->getOffset() returns the offset from start of the
456     // compile unit.
457     DwarfCompileUnit *CU = DD->lookupUnit(Entry->getUnit());
458     assert(CU && "CUDie should belong to a CU.");
459     Addr += CU->getDebugInfoOffset();
460     if (AP->MAI->doesDwarfUseRelocationsAcrossSections())
461       AP->EmitLabelPlusOffset(CU->getSectionSym(), Addr,
462                               DIEEntry::getRefAddrSize(AP));
463     else
464       AP->OutStreamer->EmitIntValue(Addr, DIEEntry::getRefAddrSize(AP));
465   } else
466     AP->EmitInt32(Entry->getOffset());
467 }
468
469 unsigned DIEEntry::getRefAddrSize(const AsmPrinter *AP) {
470   // DWARF4: References that use the attribute form DW_FORM_ref_addr are
471   // specified to be four bytes in the DWARF 32-bit format and eight bytes
472   // in the DWARF 64-bit format, while DWARF Version 2 specifies that such
473   // references have the same size as an address on the target system.
474   const DwarfDebug *DD = AP->getDwarfDebug();
475   assert(DD && "Expected Dwarf Debug info to be available");
476   if (DD->getDwarfVersion() == 2)
477     return AP->getPointerSize();
478   return sizeof(int32_t);
479 }
480
481 #ifndef NDEBUG
482 void DIEEntry::print(raw_ostream &O) const {
483   O << format("Die: 0x%lx", (long)(intptr_t)&Entry);
484 }
485 #endif
486
487 //===----------------------------------------------------------------------===//
488 // DIETypeSignature Implementation
489 //===----------------------------------------------------------------------===//
490 void DIETypeSignature::EmitValue(const AsmPrinter *Asm,
491                                  dwarf::Form Form) const {
492   assert(Form == dwarf::DW_FORM_ref_sig8);
493   Asm->OutStreamer->EmitIntValue(Unit->getTypeSignature(), 8);
494 }
495
496 #ifndef NDEBUG
497 void DIETypeSignature::print(raw_ostream &O) const {
498   O << format("Type Unit: 0x%lx", Unit->getTypeSignature());
499 }
500 #endif
501
502 //===----------------------------------------------------------------------===//
503 // DIELoc Implementation
504 //===----------------------------------------------------------------------===//
505
506 /// ComputeSize - calculate the size of the location expression.
507 ///
508 unsigned DIELoc::ComputeSize(const AsmPrinter *AP) const {
509   if (!Size) {
510     for (const auto &V : Values)
511       Size += V.SizeOf(AP);
512   }
513
514   return Size;
515 }
516
517 /// EmitValue - Emit location data.
518 ///
519 void DIELoc::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
520   switch (Form) {
521   default: llvm_unreachable("Improper form for block");
522   case dwarf::DW_FORM_block1: Asm->EmitInt8(Size);    break;
523   case dwarf::DW_FORM_block2: Asm->EmitInt16(Size);   break;
524   case dwarf::DW_FORM_block4: Asm->EmitInt32(Size);   break;
525   case dwarf::DW_FORM_block:
526   case dwarf::DW_FORM_exprloc:
527     Asm->EmitULEB128(Size); break;
528   }
529
530   for (const auto &V : Values)
531     V.EmitValue(Asm);
532 }
533
534 /// SizeOf - Determine size of location data in bytes.
535 ///
536 unsigned DIELoc::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
537   switch (Form) {
538   case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
539   case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
540   case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
541   case dwarf::DW_FORM_block:
542   case dwarf::DW_FORM_exprloc:
543     return Size + getULEB128Size(Size);
544   default: llvm_unreachable("Improper form for block");
545   }
546 }
547
548 #ifndef NDEBUG
549 void DIELoc::print(raw_ostream &O) const {
550   O << "ExprLoc: ";
551   DIE::print(O, 5);
552 }
553 #endif
554
555 //===----------------------------------------------------------------------===//
556 // DIEBlock Implementation
557 //===----------------------------------------------------------------------===//
558
559 /// ComputeSize - calculate the size of the block.
560 ///
561 unsigned DIEBlock::ComputeSize(const AsmPrinter *AP) const {
562   if (!Size) {
563     for (const auto &V : Values)
564       Size += V.SizeOf(AP);
565   }
566
567   return Size;
568 }
569
570 /// EmitValue - Emit block data.
571 ///
572 void DIEBlock::EmitValue(const AsmPrinter *Asm, dwarf::Form Form) const {
573   switch (Form) {
574   default: llvm_unreachable("Improper form for block");
575   case dwarf::DW_FORM_block1: Asm->EmitInt8(Size);    break;
576   case dwarf::DW_FORM_block2: Asm->EmitInt16(Size);   break;
577   case dwarf::DW_FORM_block4: Asm->EmitInt32(Size);   break;
578   case dwarf::DW_FORM_block:  Asm->EmitULEB128(Size); break;
579   }
580
581   for (const auto &V : Values)
582     V.EmitValue(Asm);
583 }
584
585 /// SizeOf - Determine size of block data in bytes.
586 ///
587 unsigned DIEBlock::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
588   switch (Form) {
589   case dwarf::DW_FORM_block1: return Size + sizeof(int8_t);
590   case dwarf::DW_FORM_block2: return Size + sizeof(int16_t);
591   case dwarf::DW_FORM_block4: return Size + sizeof(int32_t);
592   case dwarf::DW_FORM_block:  return Size + getULEB128Size(Size);
593   default: llvm_unreachable("Improper form for block");
594   }
595 }
596
597 #ifndef NDEBUG
598 void DIEBlock::print(raw_ostream &O) const {
599   O << "Blk: ";
600   DIE::print(O, 5);
601 }
602 #endif
603
604 //===----------------------------------------------------------------------===//
605 // DIELocList Implementation
606 //===----------------------------------------------------------------------===//
607
608 unsigned DIELocList::SizeOf(const AsmPrinter *AP, dwarf::Form Form) const {
609   if (Form == dwarf::DW_FORM_data4)
610     return 4;
611   if (Form == dwarf::DW_FORM_sec_offset)
612     return 4;
613   return AP->getPointerSize();
614 }
615
616 /// EmitValue - Emit label value.
617 ///
618 void DIELocList::EmitValue(const AsmPrinter *AP, dwarf::Form Form) const {
619   DwarfDebug *DD = AP->getDwarfDebug();
620   MCSymbol *Label = DD->getDebugLocs().getList(Index).Label;
621   AP->emitDwarfSymbolReference(Label, /*ForceOffset*/ DD->useSplitDwarf());
622 }
623
624 #ifndef NDEBUG
625 void DIELocList::print(raw_ostream &O) const { O << "LocList: " << Index; }
626 #endif