Skip to content

Commit 6322f79

Browse files
sschrinerpgoodmanalessandrogario
authored
New arch support (#461)
* This branch contains support for new architectures. * Initial start to support for AArch 32 * Progress * Forgot the new files * Added all data Integer processing instructions without S + ADDS and started ANDS * Updated * Finished Integer Data Processing with three registers, added integer data processing with 2 regs + immediate, started MUL instructions * UMULL, UMULLS, UMLAL, UMLALS * Corrected condition for addend or 0 immediate for UMULL/UMLAL + SMULL/SMLAL instructions * Correct ops in Binary.cpp * UMAAL * SMULL, SMULLS, SMLAL, SMLALS + corrected acc was missing shift left in concatination * Updated decoding instructions based on top level encodings * Update returns around kDataProcessingRI and kDataProcessingI with comments to explain the correlation to the instruction rep * Added appropriate inst.category flags to Multiply and accumulate * Load/Store Word, Unsigned Byte (immediate, literal) && start of Logical Arithmetic (three register, immediate shift) * Was missing UMAAL DEF_ISEL in Binary.cpp * AddAddrRegOp * Logical Arithmetic (three register, immediate shift) without accounting for the possible PC jump * Made DecodeA32ExpandImm much much smaller * Replaced some imm ops with AddImmOp calls * Created AddShiftOp * Added interpreter for evaluating new PC value at decoding time to handle direct jumps and conditional jumps * Created EvalPCDest added PC evaluation to Logical Arithmetic Instructions * AddShiftOp -> AddShiftOp, AddShiftThenExtractOp, AddExtractThenShiftOp * Cleaned up some formatting, Renamed DecodeA32ExpandImm to ExpandTo32AddImmAddCarry and added a clarifying comment * Added comment to EvalPCDest for clarity * Cleaned up some things, updated the decoding semantics and semantics for the logical instructions * Shortened kLogArithEvaluators and fixed a bug * Updates from testing instructions * Fixed DEF_ISEL for pre/post index instructions in MEM.cpp * Integer Test and Compare (two register, immediate shift) * Logical Arithmetic (two register and immediate) * Integer Test and Compare (one register and immediate) * Added to the top level encoding infrastructure to handle the Data-processing register (register shift) set of instructions and 3 corresponding subsets * Add structs for the 3 subsets of Data-processing register (register shift) * Code status before refactoring operand types * This branch contains support for new architectures. * Initial start to support for AArch 32 * Progress * Forgot the new files * Added all data Integer processing instructions without S + ADDS and started ANDS * Updated * Finished Integer Data Processing with three registers, added integer data processing with 2 regs + immediate, started MUL instructions * UMULL, UMULLS, UMLAL, UMLALS * Corrected condition for addend or 0 immediate for UMULL/UMLAL + SMULL/SMLAL instructions * Correct ops in Binary.cpp * UMAAL * SMULL, SMULLS, SMLAL, SMLALS + corrected acc was missing shift left in concatination * Updated decoding instructions based on top level encodings * Update returns around kDataProcessingRI and kDataProcessingI with comments to explain the correlation to the instruction rep * Added appropriate inst.category flags to Multiply and accumulate * Load/Store Word, Unsigned Byte (immediate, literal) && start of Logical Arithmetic (three register, immediate shift) * Was missing UMAAL DEF_ISEL in Binary.cpp * AddAddrRegOp * Logical Arithmetic (three register, immediate shift) without accounting for the possible PC jump * Made DecodeA32ExpandImm much much smaller * Replaced some imm ops with AddImmOp calls * Created AddShiftOp * Added interpreter for evaluating new PC value at decoding time to handle direct jumps and conditional jumps * Created EvalPCDest added PC evaluation to Logical Arithmetic Instructions * AddShiftOp -> AddShiftOp, AddShiftThenExtractOp, AddExtractThenShiftOp * Cleaned up some formatting, Renamed DecodeA32ExpandImm to ExpandTo32AddImmAddCarry and added a clarifying comment * Added comment to EvalPCDest for clarity * Cleaned up some things, updated the decoding semantics and semantics for the logical instructions * Shortened kLogArithEvaluators and fixed a bug * Updates from testing instructions * Fixed DEF_ISEL for pre/post index instructions in MEM.cpp * Integer Test and Compare (two register, immediate shift) * Logical Arithmetic (two register and immediate) * Integer Test and Compare (one register and immediate) * Added to the top level encoding infrastructure to handle the Data-processing register (register shift) set of instructions and 3 corresponding subsets * Add structs for the 3 subsets of Data-processing register (register shift) * Code status before refactoring operand types * Finished updates off master * Start of operand refactor * Finished Expression Operand Support * Fix the .gitignore to add AArch32 to lib/Arch && removed all extra rrx ops from semantics * Updated .gitignore again, Added AddShiftRegRegOperand, Updated AddShiftRegImmOperand, Finished Register shift instructions for Integer Test and Compare, Logical Arithmetic, Integer Data Processing * Updated ROR in AddShiftRegRegOperand * Created ExtractAndZExtExpr * Fixed comment formatting in if else statements * Created RORExpr * Small fixes * Small fix in Logical Arithmetic (two register and immediate) * Corrected AddShiftRegRegOperand and cleaned it up. Split the carry op into a separate function. * conditional support + Start of Branch instructions * Created AddExprOp, cleaned up some expressions in reg shifted reg, and updated some occurances of ShiftThenExtractOp with ExtractAndZExtExpr * Updates from testing register shifted by register value inst * Fix to ROR in AddShiftRegCarryOperand * Corrected negation in DecodeCondition * DecodeCondition edit * DecodeCondition and AddShiftRegCarryOperand edits * Updated arch_for_decode to arch * Halfword Multiply and Accumulate * Edits from testing Halfword Multiply and Accumulate * Changed order of operands in Halfword Multiply and Accumulate to better reflect inst format + updated inst errors * Branch (Imm) & BX/BXL * Update aarch32 cmake * cmake update * CLZ * Forgot BITBYTE.cpp * MOVT * Integer Saturating Arithmetic * updated semantics in SMLAWh & SMLAh to use Select for setting PSTATE.Q * Started Load/Store Word, Unsigned Byte (register) & fixed MOV halfword * Load/Store Word, Unsigned Byte (register) * Finished testing load/Store Word, Unsigned Byte (register) * Load/Store Dual, Half, Signed Byte (register) * Rest of Extra load store: Load/Store Dual, Half, Signed Byte (immediate, literal) * Finished testing all the Load/store additions * Signed multiply, Divide * Cleaned up SExt some * Saturate Insts and Start of Load Store Multiple - STMDB and LDM (aliases which support PUSH and POP of multiple regs) * Condensed args in STMDB and LDM semantics * Rest of Multiple Load/Store that do not execute in a different mode * Bitfield Extract * Extend and Add * fix * NOP * Small fix * Simplified the bit reps in TryMoveSpecialRegisterAndHintsI * Moved Bitfield extract semantics out of BINARY and into BITBYTE * Finished correcting S/ZExt and Trunc use * Ran scripts/format-files to format * Smoke Test * Add false delay slot to kCategoryConditionalDirectFunctionCall * CI: Use single packaging job, add changelog support (#491) * CI: Add tag handler (#492) * Delay slot fixes to TraceLifter Co-authored-by: Peter Goodman <peter.goodman@gmail.com> Co-authored-by: Alessandro Gario <5714290+alessandrogario@users.noreply.github.com>
1 parent 71cdec9 commit 6322f79

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+9471
-3616
lines changed

.github/workflows/vcpkg_ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ jobs:
6363
run: |
6464
remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
6565
remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
66+
remill-lift-${{ matrix.llvm }} --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
6667
6768
- name: Locate the packages
6869
id: package_names
@@ -123,6 +124,7 @@ jobs:
123124
run: |
124125
remill-lift-${{ matrix.llvm }} --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
125126
remill-lift-${{ matrix.llvm }} --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
127+
remill-lift-${{ matrix.llvm }} --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
126128
127129
- name: Locate the packages
128130
id: package_names

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ else()
183183
endif()
184184

185185
set(REMILL_BUILD_SEMANTICS_DIR_X86 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/X86/Runtime")
186+
set(REMILL_BUILD_SEMANTICS_DIR_AARCH32 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/AArch32/Runtime")
186187
set(REMILL_BUILD_SEMANTICS_DIR_AARCH64 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/AArch64/Runtime")
187188
set(REMILL_BUILD_SEMANTICS_DIR_SPARC32 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/SPARC32/Runtime")
188189
set(REMILL_BUILD_SEMANTICS_DIR_SPARC64 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/SPARC64/Runtime")
@@ -265,6 +266,7 @@ endif()
265266
target_compile_definitions(remill_settings INTERFACE
266267
"REMILL_INSTALL_SEMANTICS_DIR=\"${REMILL_INSTALL_SEMANTICS_DIR}/\""
267268
"REMILL_BUILD_SEMANTICS_DIR_X86=\"${REMILL_BUILD_SEMANTICS_DIR_X86}\""
269+
"REMILL_BUILD_SEMANTICS_DIR_AARCH32=\"${REMILL_BUILD_SEMANTICS_DIR_AARCH32}\""
268270
"REMILL_BUILD_SEMANTICS_DIR_AARCH64=\"${REMILL_BUILD_SEMANTICS_DIR_AARCH64}\""
269271
"REMILL_BUILD_SEMANTICS_DIR_SPARC32=\"${REMILL_BUILD_SEMANTICS_DIR_SPARC32}\""
270272
"REMILL_BUILD_SEMANTICS_DIR_SPARC64=\"${REMILL_BUILD_SEMANTICS_DIR_SPARC64}\""
@@ -347,6 +349,7 @@ endif()
347349
set(REMILL_BC_LIBRARY_LOCATION "${REMILL_INSTALL_LIB_DIR}/${static_lib_prefix}remill_bc.${static_lib_extension}")
348350
set(REMILL_ARCH_LIBRARY_LOCATION "${REMILL_INSTALL_LIB_DIR}/${static_lib_prefix}remill_arch.${static_lib_extension}")
349351
set(REMILL_ARCH_X86_LIBRARY_LOCATION "${REMILL_INSTALL_LIB_DIR}/${static_lib_prefix}remill_arch_x86.${static_lib_extension}")
352+
set(REMILL_ARCH_AARCH32_LIBRARY_LOCATION "${REMILL_INSTALL_LIB_DIR}/${static_lib_prefix}remill_arch_aarch32.${static_lib_extension}")
350353
set(REMILL_ARCH_AARCH64_LIBRARY_LOCATION "${REMILL_INSTALL_LIB_DIR}/${static_lib_prefix}remill_arch_aarch64.${static_lib_extension}")
351354
set(REMILL_ARCH_SPARC32_LIBRARY_LOCATION "${REMILL_INSTALL_LIB_DIR}/${static_lib_prefix}remill_arch_sparc32.${static_lib_extension}")
352355
set(REMILL_ARCH_SPARC64_LIBRARY_LOCATION "${REMILL_INSTALL_LIB_DIR}/${static_lib_prefix}remill_arch_sparc64.${static_lib_extension}")

CMakeLists_vcpkg.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ math(EXPR REMILL_LLVM_VERSION_NUMBER "${LLVM_MAJOR_VERSION} * 100 + ${LLVM_MINOR
145145
set(REMILL_INSTALL_SEMANTICS_DIR "${CMAKE_INSTALL_PREFIX}/${REMILL_INSTALL_SHARE_DIR}/remill/${REMILL_LLVM_VERSION}/semantics" CACHE PATH "Directory into which semantics are installed")
146146

147147
set(REMILL_BUILD_SEMANTICS_DIR_X86 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/X86/Runtime")
148+
set(REMILL_BUILD_SEMANTICS_DIR_AARCH32 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/AArch32/Runtime")
148149
set(REMILL_BUILD_SEMANTICS_DIR_AARCH64 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/AArch64/Runtime")
149150
set(REMILL_BUILD_SEMANTICS_DIR_SPARC32 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/SPARC32/Runtime")
150151
set(REMILL_BUILD_SEMANTICS_DIR_SPARC64 "${CMAKE_CURRENT_BINARY_DIR}/lib/Arch/SPARC64/Runtime")
@@ -231,6 +232,7 @@ endif()
231232
target_compile_definitions(remill_settings INTERFACE
232233
"REMILL_INSTALL_SEMANTICS_DIR=\"${REMILL_INSTALL_SEMANTICS_DIR}\""
233234
"REMILL_BUILD_SEMANTICS_DIR_X86=\"${REMILL_BUILD_SEMANTICS_DIR_X86}\""
235+
"REMILL_BUILD_SEMANTICS_DIR_AARCH32=\"${REMILL_BUILD_SEMANTICS_DIR_AARCH32}\""
234236
"REMILL_BUILD_SEMANTICS_DIR_AARCH64=\"${REMILL_BUILD_SEMANTICS_DIR_AARCH64}\""
235237
"REMILL_BUILD_SEMANTICS_DIR_SPARC32=\"${REMILL_BUILD_SEMANTICS_DIR_SPARC32}\""
236238
"REMILL_BUILD_SEMANTICS_DIR_SPARC64=\"${REMILL_BUILD_SEMANTICS_DIR_SPARC64}\""

cmake/remillConfig.cmake.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ if(NOT TARGET remill)
6565
add_library(remill_arch_x86 STATIC IMPORTED)
6666
set_property(TARGET remill_arch_x86 PROPERTY IMPORTED_LOCATION "@REMILL_ARCH_X86_LIBRARY_LOCATION@")
6767

68+
add_library(remill_arch_aarch32 STATIC IMPORTED)
69+
set_property(TARGET remill_arch_aarch32 PROPERTY IMPORTED_LOCATION "@REMILL_ARCH_AARCH32_LIBRARY_LOCATION@")
70+
6871
add_library(remill_arch_aarch64 STATIC IMPORTED)
6972
set_property(TARGET remill_arch_aarch64 PROPERTY IMPORTED_LOCATION "@REMILL_ARCH_AARCH64_LIBRARY_LOCATION@")
7073

@@ -84,6 +87,7 @@ if(NOT TARGET remill)
8487
remill_os
8588
remill_arch
8689
remill_arch_x86
90+
remill_arch_aarch32
8791
remill_arch_aarch64
8892
remill_arch_sparc32
8993
remill_arch_sparc64
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright (c) 2017 Trail of Bits, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
19+
namespace {
20+
21+
// Read a register directly. Sometimes this is needed for suppressed operands.
22+
ALWAYS_INLINE static addr_t _Read(Memory *, Reg reg) {
23+
return reg.aword;
24+
}
25+
26+
// Write directly to a register. This is sometimes needed for suppressed
27+
// register operands.
28+
ALWAYS_INLINE static void _Write(Memory *, Reg &reg, addr_t val) {
29+
reg.aword = val;
30+
}
31+
32+
} // namespace
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/*
2+
* Copyright (c) 2017 Trail of Bits, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
19+
#pragma clang diagnostic push
20+
#pragma clang diagnostic fatal "-Wpadded"
21+
22+
#include "remill/Arch/Runtime/State.h"
23+
#include "remill/Arch/Runtime/Types.h"
24+
25+
struct Reg final {
26+
alignas(4) uint32_t dword;
27+
} __attribute__((packed));
28+
29+
static_assert(sizeof(uint32_t) == sizeof(Reg), "Invalid packing of `Reg`.");
30+
static_assert(0 == __builtin_offsetof(Reg, dword),
31+
"Invalid packing of `Reg::dword`.");
32+
33+
struct alignas(8) GPR final {
34+
35+
// Prevents LLVM from casting a `GPR` into an `i64` to access `X0`.
36+
volatile uint32_t _0;
37+
Reg r0;
38+
volatile uint32_t _1;
39+
Reg r1;
40+
volatile uint32_t _2;
41+
Reg r2;
42+
volatile uint32_t _3;
43+
Reg r3;
44+
volatile uint32_t _4;
45+
Reg r4;
46+
volatile uint32_t _5;
47+
Reg r5;
48+
volatile uint32_t _6;
49+
Reg r6;
50+
volatile uint32_t _7;
51+
Reg r7;
52+
volatile uint32_t _8;
53+
Reg r8;
54+
volatile uint32_t _9;
55+
Reg r9;
56+
volatile uint32_t _10;
57+
Reg r10;
58+
volatile uint32_t _11;
59+
Reg r11;
60+
volatile uint32_t _12;
61+
Reg r12;
62+
63+
// R13 is SP (stack pointer)
64+
volatile uint32_t _13;
65+
Reg r13;
66+
67+
// R14 is LR (link register)
68+
volatile uint32_t _14;
69+
Reg r14;
70+
71+
// R15 is PC (program counter)
72+
volatile uint32_t _15;
73+
Reg r15;
74+
75+
76+
} __attribute__((packed));
77+
78+
// System registers affecting control and status of the machine.
79+
struct alignas(8) SR final {
80+
81+
uint8_t _2;
82+
uint8_t n; // Negative condition flag.
83+
uint8_t _3;
84+
uint8_t z; // Zero condition flag
85+
uint8_t _4;
86+
uint8_t c; // Carry condition flag
87+
uint8_t _5;
88+
uint8_t v; // Overflow condition flag
89+
90+
uint8_t _6;
91+
uint8_t ixc; // Inexact (cumulative).
92+
uint8_t _7;
93+
uint8_t ofc; // Overflow (cumulative).
94+
uint8_t _8;
95+
uint8_t ufc; // Underflow (cumulative).
96+
uint8_t _9;
97+
uint8_t idc; // Input denormal (cumulative).
98+
uint8_t _10;
99+
uint8_t ioc; // Invalid operation (cumulative).
100+
uint8_t _11;
101+
uint8_t q; // Sticky overflow bit.
102+
103+
uint8_t _padding[4];
104+
} __attribute__((packed));
105+
106+
struct alignas(16) State final : public ArchState {
107+
108+
109+
GPR gpr; // 528 bytes.
110+
SR sr;
111+
uint64_t _0;
112+
113+
114+
} __attribute__((packed));
115+
116+
using AArch32State = State;
117+
118+
#pragma clang diagnostic pop
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/*
2+
* Copyright (c) 2017 Trail of Bits, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#pragma once
18+
19+
// We need this for boolean conditions, used in branch instructions.
20+
typedef RnW<uint8_t> R8W;
21+
22+
typedef RnW<uint8_t> R8W;
23+
typedef RnW<uint16_t> R16W;
24+
25+
// Note: AArch64 zero-extends like x86, but the smallest register size that
26+
// can be accessed is 32 bits.
27+
typedef RnW<uint32_t> R32W;
28+
29+
typedef Rn<uint8_t> R8;
30+
31+
//typedef Rn<uint16_t> R16;
32+
typedef Rn<uint32_t> R32;
33+
34+
typedef Vn<vec8_t> V8;
35+
typedef Vn<vec16_t> V16;
36+
typedef Vn<vec32_t> V32;
37+
typedef Vn<vec64_t> V64;
38+
typedef Vn<vec128_t> V128;
39+
typedef VnW<vec128_t> V128W;
40+
41+
typedef MnW<uint8_t> M8W;
42+
typedef MnW<uint16_t> M16W;
43+
typedef MnW<uint32_t> M32W;
44+
typedef MnW<uint64_t> M64W;
45+
46+
typedef MVnW<vec8_t> MV8W;
47+
typedef MVnW<vec16_t> MV16W;
48+
typedef MVnW<vec32_t> MV32W;
49+
typedef MVnW<vec64_t> MV64W;
50+
typedef MVnW<vec128_t> MV128W;
51+
52+
typedef Mn<uint8_t> M8;
53+
typedef Mn<uint16_t> M16;
54+
55+
typedef Mn<uint32_t> M32;
56+
typedef Mn<uint64_t> M64;
57+
58+
typedef MVn<vec8_t> MV8;
59+
typedef MVn<vec16_t> MV16;
60+
typedef MVn<vec32_t> MV32;
61+
typedef MVn<vec64_t> MV64;
62+
typedef MVn<vec128_t> MV128;
63+
typedef MVn<vec256_t> MV256;
64+
65+
typedef In<uint8_t> I8;
66+
typedef In<uint16_t> I16;
67+
typedef In<uint32_t> I32;
68+
69+
typedef In<float32_t> F32;
70+
typedef In<float64_t> F64;
71+
72+
typedef In<addr_t> PC;
73+
typedef In<addr_t> ADDR;

include/remill/Arch/Arch.h

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <llvm/IR/DataLayout.h>
3232
#include <llvm/IR/IRBuilder.h>
3333
#pragma clang diagnostic pop
34+
3435
// clang-format on
3536

3637
#include <functional>
@@ -134,12 +135,12 @@ class Arch {
134135
// Factory method for loading the correct architecture class for a given
135136
// operating system and architecture class.
136137
static auto Get(llvm::LLVMContext &context, std::string_view os,
137-
std::string_view arch_name) -> ArchPtr;
138+
std::string_view arch_name) -> ArchPtr;
138139

139140
// Factory method for loading the correct architecture class for a given
140141
// operating system and architecture class.
141-
static auto Get(llvm::LLVMContext &context, OSName os,
142-
ArchName arch_name) -> ArchPtr;
142+
static auto Get(llvm::LLVMContext &context, OSName os, ArchName arch_name)
143+
-> ArchPtr;
143144

144145
// Return the type of the state structure.
145146
llvm::StructType *StateStructType(void) const;
@@ -246,6 +247,7 @@ class Arch {
246247

247248
bool IsX86(void) const;
248249
bool IsAMD64(void) const;
250+
bool IsAArch32(void) const;
249251
bool IsAArch64(void) const;
250252
bool IsSPARC32(void) const;
251253
bool IsSPARC64(void) const;
@@ -278,26 +280,29 @@ class Arch {
278280
llvm::Triple BasicTriple(void) const;
279281

280282
// Add a register into this
281-
const Register *AddRegister(const char *reg_name,
282-
llvm::Type *val_type, size_t offset,
283-
const char *parent_reg_name) const;
283+
const Register *AddRegister(const char *reg_name, llvm::Type *val_type,
284+
size_t offset, const char *parent_reg_name) const;
284285

285286
private:
286287
// Defined in `lib/Arch/X86/Arch.cpp`.
287288
static ArchPtr GetX86(llvm::LLVMContext *context, OSName os,
288289
ArchName arch_name);
289290

291+
// Defined in `lib/Arch/AArch32/Arch.cpp`.
292+
static ArchPtr GetAArch32(llvm::LLVMContext *context, OSName os,
293+
ArchName arch_name);
294+
290295
// Defined in `lib/Arch/AArch64/Arch.cpp`.
291296
static ArchPtr GetAArch64(llvm::LLVMContext *context, OSName os,
292297
ArchName arch_name);
293298

294299
// Defined in `lib/Arch/SPARC32/Arch.cpp`.
295-
static ArchPtr GetSPARC(
296-
llvm::LLVMContext *context, OSName os, ArchName arch_name);
300+
static ArchPtr GetSPARC(llvm::LLVMContext *context, OSName os,
301+
ArchName arch_name);
297302

298303
// Defined in `lib/Arch/SPARC64/Arch.cpp`.
299-
static ArchPtr GetSPARC64(
300-
llvm::LLVMContext *context, OSName os, ArchName arch_name);
304+
static ArchPtr GetSPARC64(llvm::LLVMContext *context, OSName os,
305+
ArchName arch_name);
301306

302307
mutable std::unique_ptr<ArchImpl> impl;
303308

0 commit comments

Comments
 (0)