aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2012-08-08 23:56:06 +0000
committerJim Grosbach <grosbach@apple.com>2012-08-08 23:56:06 +0000
commit2d39a0e52df9ce050bd4e2de3a2ecca8fd9a87c3 (patch)
tree5cbceaa7838dcbf235112928cd53adf48e3b5244 /lib/MC/MCDwarf.cpp
parentfdd6484b41ef0fa7eb8c995fb34b728b193c6258 (diff)
downloadexternal_llvm-2d39a0e52df9ce050bd4e2de3a2ecca8fd9a87c3.zip
external_llvm-2d39a0e52df9ce050bd4e2de3a2ecca8fd9a87c3.tar.gz
external_llvm-2d39a0e52df9ce050bd4e2de3a2ecca8fd9a87c3.tar.bz2
Move [SU]LEB128 encoding to a utility header.
These functions are very generic. There's no reason for them to be tied to MCObjectWriter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCDwarf.cpp')
-rw-r--r--lib/MC/MCDwarf.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp
index 75eaf80..722779a 100644
--- a/lib/MC/MCDwarf.cpp
+++ b/lib/MC/MCDwarf.cpp
@@ -19,6 +19,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/LEB128.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/ADT/Hashing.h"
@@ -361,7 +362,7 @@ void MCDwarfLineAddr::Encode(int64_t LineDelta, uint64_t AddrDelta,
OS << char(dwarf::DW_LNS_const_add_pc);
else {
OS << char(dwarf::DW_LNS_advance_pc);
- MCObjectWriter::EncodeULEB128(AddrDelta, OS);
+ encodeULEB128(AddrDelta, OS);
}
OS << char(dwarf::DW_LNS_extended_op);
OS << char(1);
@@ -376,7 +377,7 @@ void MCDwarfLineAddr::Encode(int64_t LineDelta, uint64_t AddrDelta,
// it with DW_LNS_advance_line.
if (Temp >= DWARF2_LINE_RANGE) {
OS << char(dwarf::DW_LNS_advance_line);
- MCObjectWriter::EncodeSLEB128(LineDelta, OS);
+ encodeSLEB128(LineDelta, OS);
LineDelta = 0;
Temp = 0 - DWARF2_LINE_BASE;
@@ -412,7 +413,7 @@ void MCDwarfLineAddr::Encode(int64_t LineDelta, uint64_t AddrDelta,
// Otherwise use DW_LNS_advance_pc.
OS << char(dwarf::DW_LNS_advance_pc);
- MCObjectWriter::EncodeULEB128(AddrDelta, OS);
+ encodeULEB128(AddrDelta, OS);
if (NeedCopy)
OS << char(dwarf::DW_LNS_copy);