From 91cb54e6caf8b06546c416e7f7467f1c03b3a757 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Fri, 15 Jan 2016 13:47:59 +0000 Subject: Create helper class for DWARF expressions. This ensures we generate valid DWARF opcodes and it slightly simplifies the debug info writer. Change-Id: I2ef8a9222c9a129c58f500741acd209b67e2ecff --- compiler/dwarf/writer.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'compiler/dwarf/writer.h') diff --git a/compiler/dwarf/writer.h b/compiler/dwarf/writer.h index d2add7f026..74acf07abe 100644 --- a/compiler/dwarf/writer.h +++ b/compiler/dwarf/writer.h @@ -114,16 +114,16 @@ class Writer { data_->insert(data_->end(), value, value + strlen(value) + 1); } - void PushData(const void* ptr, size_t num_bytes) { - const char* p = reinterpret_cast(ptr); - data_->insert(data_->end(), p, p + num_bytes); + void PushData(const uint8_t* ptr, size_t num_bytes) { + data_->insert(data_->end(), ptr, ptr + num_bytes); } - template - void PushData(const Vector2& buffer) { - static_assert(std::is_same::type, - const uint8_t>::value, "Invalid value type"); - data_->insert(data_->end(), buffer.begin(), buffer.end()); + void PushData(const char* ptr, size_t num_bytes) { + data_->insert(data_->end(), ptr, ptr + num_bytes); + } + + void PushData(const Vector* buffer) { + data_->insert(data_->end(), buffer->begin(), buffer->end()); } void UpdateUint32(size_t offset, uint32_t value) { -- cgit v1.2.3-59-g8ed1b