Make the checks for DW_FORM_data4 consistent with the others, and
authorDan Gohman <gohman@apple.com>
Fri, 28 Sep 2007 16:50:28 +0000 (16:50 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 28 Sep 2007 16:50:28 +0000 (16:50 +0000)
add more such code for DIEDwarfLabel::SizeOf and DIEObjectLabel::SizeOf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42435 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/DwarfWriter.cpp

index faebaacfd7d713041f7498fcf244fca541091b64..e6ed8f0bffa544f8539db64daf6bcfa3bd06bd0a 100644 (file)
@@ -3481,12 +3481,14 @@ void DIEString::EmitValue(DwarfDebug &DD, unsigned Form) {
 /// EmitValue - Emit label value.
 ///
 void DIEDwarfLabel::EmitValue(DwarfDebug &DD, unsigned Form) {
-  DD.EmitReference(Label, false, Form == DW_FORM_data4);
+  bool IsSmall = Form == DW_FORM_data4;
+  DD.EmitReference(Label, false, IsSmall);
 }
 
 /// SizeOf - Determine size of label value in bytes.
 ///
 unsigned DIEDwarfLabel::SizeOf(const DwarfDebug &DD, unsigned Form) const {
+  if (Form == DW_FORM_data4) return 4;
   return DD.getTargetData()->getPointerSize();
 }
 
@@ -3495,12 +3497,14 @@ unsigned DIEDwarfLabel::SizeOf(const DwarfDebug &DD, unsigned Form) const {
 /// EmitValue - Emit label value.
 ///
 void DIEObjectLabel::EmitValue(DwarfDebug &DD, unsigned Form) {
-  DD.EmitReference(Label, false, Form == DW_FORM_data4);
+  bool IsSmall = Form == DW_FORM_data4;
+  DD.EmitReference(Label, false, IsSmall);
 }
 
 /// SizeOf - Determine size of label value in bytes.
 ///
 unsigned DIEObjectLabel::SizeOf(const DwarfDebug &DD, unsigned Form) const {
+  if (Form == DW_FORM_data4) return 4;
   return DD.getTargetData()->getPointerSize();
 }