Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix register includes in unusedArgs.C #52

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion unusedArgs/unusedArgs.C
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@
#include "Symtab.h"
#include "Function.h"
#include "liveness.h"
#include "registers/x86_64_regs.h"

using namespace Dyninst;
using namespace SymtabAPI;
using namespace ParseAPI;
using namespace std;

#if defined(__x86_64__)
#include "registers/x86_64_regs.h"
// Based on Figure 3.4: Register Usage of
// https://web.archive.org/web/20160801075146/http://www.x86-64.org/documentation/abi.pdf
const MachRegister arg_register[] = {x86_64::rdi, x86_64::rsi, x86_64::rdx, x86_64::rcx, x86_64::r8, x86_64::r9};
#elif defined(__aarch64__)
#include "registers/aarch64_regs.h"
// aarch64 calling conventions from https://developer.arm.com/documentation/ihi0055/d/
const MachRegister arg_register[] = {aarch64::x0, aarch64::x1, aarch64::x2, aarch64::x3,
aarch64::x4, aarch64::x5, aarch64::x6, aarch64::x7};
#elif defined(__powerpc__)
#include "registers/ppc32_regs.h"
#include "registers/ppc64_regs.h"
// 64-bit powerpc calling conventions from https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#REG
const MachRegister arg_register[] = {ppc64::r3, ppc64::r4, ppc64::r5, ppc64::r6,
ppc64::r7, ppc64::r8, ppc64::r9, ppc64::r10 };
Expand Down