[llvm] [JITlink][AArch32] Add some misssing function declarations (PR #71621)
Tom Stellard via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 06:06:55 PST 2023
https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/71621
>From c5dc8d00e33fce0807df678f9d603478d82b96e0 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 8 Nov 2023 01:17:43 +0000
Subject: [PATCH] [JITlink][AArch32] Move function declaration from unittest to
headers
---
.../ExecutionEngine/JITLink/ELF_aarch32.h | 3 ++
.../llvm/ExecutionEngine/JITLink/aarch32.h | 13 ++++++++
.../ExecutionEngine/JITLink/AArch32Tests.cpp | 33 +------------------
3 files changed, 17 insertions(+), 32 deletions(-)
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
index 25d1c3aac2c26e3..335a14d2013f6cf 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/ELF_aarch32.h
@@ -32,6 +32,9 @@ createLinkGraphFromELFObject_aarch32(MemoryBufferRef ObjectBuffer);
void link_ELF_aarch32(std::unique_ptr<LinkGraph> G,
std::unique_ptr<JITLinkContext> Ctx);
+Expected<uint32_t> getELFRelocationType(Edge::Kind Kind);
+Expected<aarch32::EdgeKind_aarch32> getJITLinkEdgeKind(uint32_t ELFType);
+
} // end namespace jitlink
} // end namespace llvm
diff --git a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
index 3f36b53d6684a79..b218c5a5703acc6 100644
--- a/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
+++ b/llvm/include/llvm/ExecutionEngine/JITLink/aarch32.h
@@ -335,6 +335,19 @@ class StubsManager : public TableManager<StubsManager<Flavor>> {
template <>
Symbol &StubsManager<Thumbv7>::createEntry(LinkGraph &G, Symbol &Target);
+HalfWords encodeRegMovtT1MovwT3(int64_t Value);
+int64_t decodeRegMovtT1MovwT3(unsigned int, unsigned int);
+uint16_t decodeImmMovtT1MovwT3(uint32_t Hi, uint32_t Lo);
+int64_t decodeImmBT4BlT1BlxT2_J1J2(uint32_t Hi, uint32_t Lo);
+HalfWords encodeImmMovtT1MovwT3(uint16_t Value);
+HalfWords encodeImmBT4BlT1BlxT2_J1J2(int64_t Value);
+int64_t decodeRegMovtA1MovwA2(uint64_t Value);
+uint16_t decodeImmMovtA1MovwA2(uint64_t Value);
+uint32_t encodeImmMovtA1MovwA2(uint16_t Value);
+uint32_t encodeRegMovtA1MovwA2(int64_t Value);
+int64_t decodeImmBA1BlA1BlxA2(int64_t Value);
+uint32_t encodeImmBA1BlA1BlxA2(int64_t Value);
+
} // namespace aarch32
} // namespace jitlink
} // namespace llvm
diff --git a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
index dcc8d3b237ff318..7735a68d01b4057 100644
--- a/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
+++ b/llvm/unittests/ExecutionEngine/JITLink/AArch32Tests.cpp
@@ -8,6 +8,7 @@
#include <llvm/BinaryFormat/ELF.h>
#include <llvm/ExecutionEngine/JITLink/aarch32.h>
+#include <llvm/ExecutionEngine/JITLink/ELF_aarch32.h>
#include "gtest/gtest.h"
@@ -36,14 +37,6 @@ struct MutableWord {
uint32_t Wd;
};
-namespace llvm {
-namespace jitlink {
-
-Expected<aarch32::EdgeKind_aarch32> getJITLinkEdgeKind(uint32_t ELFType);
-Expected<uint32_t> getELFRelocationType(Edge::Kind Kind);
-
-} // namespace jitlink
-} // namespace llvm
TEST(AArch32_ELF, EdgeKinds) {
// Fails: Invalid ELF type -> JITLink kind
@@ -67,30 +60,6 @@ TEST(AArch32_ELF, EdgeKinds) {
}
}
-namespace llvm {
-namespace jitlink {
-namespace aarch32 {
-
-HalfWords encodeImmBT4BlT1BlxT2(int64_t Value);
-HalfWords encodeImmBT4BlT1BlxT2_J1J2(int64_t Value);
-uint32_t encodeImmBA1BlA1BlxA2(int64_t Value);
-HalfWords encodeImmMovtT1MovwT3(uint16_t Value);
-HalfWords encodeRegMovtT1MovwT3(int64_t Value);
-uint32_t encodeImmMovtA1MovwA2(uint16_t Value);
-uint32_t encodeRegMovtA1MovwA2(int64_t Value);
-
-int64_t decodeImmBT4BlT1BlxT2(uint32_t Hi, uint32_t Lo);
-int64_t decodeImmBT4BlT1BlxT2_J1J2(uint32_t Hi, uint32_t Lo);
-int64_t decodeImmBA1BlA1BlxA2(int64_t Value);
-uint16_t decodeImmMovtT1MovwT3(uint32_t Hi, uint32_t Lo);
-int64_t decodeRegMovtT1MovwT3(uint32_t Hi, uint32_t Lo);
-uint16_t decodeImmMovtA1MovwA2(uint64_t Value);
-int64_t decodeRegMovtA1MovwA2(uint64_t Value);
-
-} // namespace aarch32
-} // namespace jitlink
-} // namespace llvm
-
// Big-endian for v7 and v8 (and v6 unless in legacy backwards compatible mode
// be32) have little-endian instructions and big-endian data. In ELF relocatable
// objects big-endian instructions may still be encountered. A be8 supporting
More information about the llvm-commits
mailing list