diff options
author | Eric Christopher <echristo@gmail.com> | 2013-08-08 01:41:00 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-08-08 01:41:00 +0000 |
commit | 31667626106048c07866d996e667a3a10010ef4b (patch) | |
tree | 48f1f51ff6f58d08eb1724e31fd312fc9928e188 /lib/CodeGen/AsmPrinter/DIE.cpp | |
parent | e32032d812f3acac34bddc81ee8151d5c4a708d8 (diff) | |
download | external_llvm-31667626106048c07866d996e667a3a10010ef4b.zip external_llvm-31667626106048c07866d996e667a3a10010ef4b.tar.gz external_llvm-31667626106048c07866d996e667a3a10010ef4b.tar.bz2 |
Be more rigorous about the sizes of forms and attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/DIE.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DIE.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/CodeGen/AsmPrinter/DIE.cpp b/lib/CodeGen/AsmPrinter/DIE.cpp index ab03861..a22fd60 100644 --- a/lib/CodeGen/AsmPrinter/DIE.cpp +++ b/lib/CodeGen/AsmPrinter/DIE.cpp @@ -122,7 +122,7 @@ DIE *DIE::getCompileUnit() { llvm_unreachable("We should not have orphaned DIEs."); } -DIEValue *DIE::findAttribute(unsigned Attribute) { +DIEValue *DIE::findAttribute(uint16_t Attribute) { const SmallVectorImpl<DIEValue *> &Values = getValues(); const DIEAbbrev &Abbrevs = getAbbrev(); @@ -199,7 +199,7 @@ void DIEValue::dump() const { /// EmitValue - Emit integer of appropriate size. /// -void DIEInteger::EmitValue(AsmPrinter *Asm, unsigned Form) const { +void DIEInteger::EmitValue(AsmPrinter *Asm, uint16_t Form) const { unsigned Size = ~0U; switch (Form) { case dwarf::DW_FORM_flag_present: @@ -231,7 +231,7 @@ void DIEInteger::EmitValue(AsmPrinter *Asm, unsigned Form) const { /// SizeOf - Determine size of integer value in bytes. /// -unsigned DIEInteger::SizeOf(AsmPrinter *AP, unsigned Form) const { +unsigned DIEInteger::SizeOf(AsmPrinter *AP, uint16_t Form) const { switch (Form) { case dwarf::DW_FORM_flag_present: return 0; case dwarf::DW_FORM_flag: // Fall thru @@ -266,13 +266,13 @@ void DIEInteger::print(raw_ostream &O) const { /// EmitValue - Emit expression value. /// -void DIEExpr::EmitValue(AsmPrinter *AP, unsigned Form) const { +void DIEExpr::EmitValue(AsmPrinter *AP, uint16_t Form) const { AP->OutStreamer.EmitValue(Expr, SizeOf(AP, Form)); } /// SizeOf - Determine size of expression value in bytes. /// -unsigned DIEExpr::SizeOf(AsmPrinter *AP, unsigned Form) const { +unsigned DIEExpr::SizeOf(AsmPrinter *AP, uint16_t Form) const { if (Form == dwarf::DW_FORM_data4) return 4; if (Form == dwarf::DW_FORM_sec_offset) return 4; if (Form == dwarf::DW_FORM_strp) return 4; @@ -292,13 +292,13 @@ void DIEExpr::print(raw_ostream &O) const { /// EmitValue - Emit label value. /// -void DIELabel::EmitValue(AsmPrinter *AP, unsigned Form) const { +void DIELabel::EmitValue(AsmPrinter *AP, uint16_t Form) const { AP->EmitLabelReference(Label, SizeOf(AP, Form)); } /// SizeOf - Determine size of label value in bytes. /// -unsigned DIELabel::SizeOf(AsmPrinter *AP, unsigned Form) const { +unsigned DIELabel::SizeOf(AsmPrinter *AP, uint16_t Form) const { if (Form == dwarf::DW_FORM_data4) return 4; if (Form == dwarf::DW_FORM_sec_offset) return 4; if (Form == dwarf::DW_FORM_strp) return 4; @@ -317,13 +317,13 @@ void DIELabel::print(raw_ostream &O) const { /// EmitValue - Emit delta value. /// -void DIEDelta::EmitValue(AsmPrinter *AP, unsigned Form) const { +void DIEDelta::EmitValue(AsmPrinter *AP, uint16_t Form) const { AP->EmitLabelDifference(LabelHi, LabelLo, SizeOf(AP, Form)); } /// SizeOf - Determine size of delta value in bytes. /// -unsigned DIEDelta::SizeOf(AsmPrinter *AP, unsigned Form) const { +unsigned DIEDelta::SizeOf(AsmPrinter *AP, uint16_t Form) const { if (Form == dwarf::DW_FORM_data4) return 4; if (Form == dwarf::DW_FORM_strp) return 4; return AP->getDataLayout().getPointerSize(); @@ -341,13 +341,13 @@ void DIEDelta::print(raw_ostream &O) const { /// EmitValue - Emit string value. /// -void DIEString::EmitValue(AsmPrinter *AP, unsigned Form) const { +void DIEString::EmitValue(AsmPrinter *AP, uint16_t Form) const { Access->EmitValue(AP, Form); } /// SizeOf - Determine size of delta value in bytes. /// -unsigned DIEString::SizeOf(AsmPrinter *AP, unsigned Form) const { +unsigned DIEString::SizeOf(AsmPrinter *AP, uint16_t Form) const { return Access->SizeOf(AP, Form); } @@ -364,7 +364,7 @@ void DIEString::print(raw_ostream &O) const { /// EmitValue - Emit debug information entry offset. /// -void DIEEntry::EmitValue(AsmPrinter *AP, unsigned Form) const { +void DIEEntry::EmitValue(AsmPrinter *AP, uint16_t Form) const { AP->EmitInt32(Entry->getOffset()); } @@ -402,7 +402,7 @@ unsigned DIEBlock::ComputeSize(AsmPrinter *AP) { /// EmitValue - Emit block data. /// -void DIEBlock::EmitValue(AsmPrinter *Asm, unsigned Form) const { +void DIEBlock::EmitValue(AsmPrinter *Asm, uint16_t Form) const { switch (Form) { default: llvm_unreachable("Improper form for block"); case dwarf::DW_FORM_block1: Asm->EmitInt8(Size); break; @@ -418,7 +418,7 @@ void DIEBlock::EmitValue(AsmPrinter *Asm, unsigned Form) const { /// SizeOf - Determine size of block data in bytes. /// -unsigned DIEBlock::SizeOf(AsmPrinter *AP, unsigned Form) const { +unsigned DIEBlock::SizeOf(AsmPrinter *AP, uint16_t Form) const { switch (Form) { case dwarf::DW_FORM_block1: return Size + sizeof(int8_t); case dwarf::DW_FORM_block2: return Size + sizeof(int16_t); |