summaryrefslogtreecommitdiff
path: root/compiler/cfi_test.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-04-11 09:58:41 +0000
committer Vladimir Marko <vmarko@google.com> 2018-04-11 11:10:10 +0100
commitca1e038eb94694f0f1f94ed3781572411c85d365 (patch)
tree90ad2c2494821c2f3d904eb42e61fbecd7acaf9d /compiler/cfi_test.h
parent3f967b25650e44cd61f5a1112727a8218f2b0804 (diff)
Revert^2 "Compile link-time thunks in codegen."
The linker crash (the reason for revert) is flaky and maybe we shall not see it with this CL now that unrelated source code has changed. Test: Rely on TreeHugger Bug: 36141117 Bug: 77581732 This reverts commit 5806a9ec99b5494b511e84c74f494f0b3a8ebec5. Change-Id: I3a4a058847dff601681ba391abf45833424fa06d
Diffstat (limited to 'compiler/cfi_test.h')
-rw-r--r--compiler/cfi_test.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/compiler/cfi_test.h b/compiler/cfi_test.h
index 29ff235cea..581edaa773 100644
--- a/compiler/cfi_test.h
+++ b/compiler/cfi_test.h
@@ -37,8 +37,8 @@ constexpr dwarf::CFIFormat kCFIFormat = dwarf::DW_DEBUG_FRAME_FORMAT;
class CFITest : public dwarf::DwarfTest {
public:
void GenerateExpected(FILE* f, InstructionSet isa, const char* isa_str,
- const std::vector<uint8_t>& actual_asm,
- const std::vector<uint8_t>& actual_cfi) {
+ ArrayRef<const uint8_t> actual_asm,
+ ArrayRef<const uint8_t> actual_cfi) {
std::vector<std::string> lines;
// Print the raw bytes.
fprintf(f, "static constexpr uint8_t expected_asm_%s[] = {", isa_str);
@@ -50,11 +50,18 @@ class CFITest : public dwarf::DwarfTest {
// Pretty-print CFI opcodes.
constexpr bool is64bit = false;
dwarf::DebugFrameOpCodeWriter<> initial_opcodes;
- dwarf::WriteCIE(is64bit, dwarf::Reg(8),
- initial_opcodes, kCFIFormat, &debug_frame_data_);
+ dwarf::WriteCIE(is64bit, dwarf::Reg(8), initial_opcodes, kCFIFormat, &debug_frame_data_);
std::vector<uintptr_t> debug_frame_patches;
- dwarf::WriteFDE(is64bit, 0, 0, 0, actual_asm.size(), ArrayRef<const uint8_t>(actual_cfi),
- kCFIFormat, 0, &debug_frame_data_, &debug_frame_patches);
+ dwarf::WriteFDE(is64bit,
+ /* section_address */ 0,
+ /* cie_address */ 0,
+ /* code_address */ 0,
+ actual_asm.size(),
+ actual_cfi,
+ kCFIFormat,
+ /* buffer_address */ 0,
+ &debug_frame_data_,
+ &debug_frame_patches);
ReformatCfi(Objdump(false, "-W"), &lines);
// Pretty-print assembly.
const uint8_t* asm_base = actual_asm.data();
@@ -142,7 +149,7 @@ class CFITest : public dwarf::DwarfTest {
}
// Pretty-print byte array. 12 bytes per line.
- static void HexDump(FILE* f, const std::vector<uint8_t>& data) {
+ static void HexDump(FILE* f, ArrayRef<const uint8_t> data) {
for (size_t i = 0; i < data.size(); i++) {
fprintf(f, i % 12 == 0 ? "\n " : " "); // Whitespace.
fprintf(f, "0x%02X,", data[i]);