[compiler-rt] 9c2f792 - [fuzzer] Enable loongarch64
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 17 18:43:05 PDT 2023
Author: Youling Tang
Date: 2023-07-18T09:40:25+08:00
New Revision: 9c2f792dceb626f57c577b02468562e1e84822f1
URL: https://github.com/llvm/llvm-project/commit/9c2f792dceb626f57c577b02468562e1e84822f1
DIFF: https://github.com/llvm/llvm-project/commit/9c2f792dceb626f57c577b02468562e1e84822f1.diff
LOG: [fuzzer] Enable loongarch64
Enable fuzzer on loongarch64.
Reviewed By: SixWeining, xen0n, MaskRay
Differential Revision: https://reviews.llvm.org/D140601
Added:
Modified:
compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
Removed:
################################################################################
diff --git a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
index 70847d2eea83df..d14745ef9d138f 100644
--- a/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
+++ b/compiler-rt/cmake/Modules/AllSupportedArchDefs.cmake
@@ -40,7 +40,7 @@ endif()
if(OS_NAME MATCHES "Linux")
set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${S390X}
- ${RISCV64})
+ ${RISCV64} ${LOONGARCH64})
elseif (OS_NAME MATCHES "Windows")
set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64})
elseif(OS_NAME MATCHES "Android")
diff --git a/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp b/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
index f12f7aa61bc4a8..7f4e8ef91c447c 100644
--- a/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
+++ b/compiler-rt/lib/fuzzer/FuzzerTracePC.cpp
@@ -149,8 +149,8 @@ inline ALWAYS_INLINE uintptr_t GetPreviousInstructionPc(uintptr_t PC) {
ALWAYS_INLINE uintptr_t TracePC::GetNextInstructionPc(uintptr_t PC) {
#if defined(__mips__)
return PC + 8;
-#elif defined(__powerpc__) || defined(__sparc__) || defined(__arm__) || \
- defined(__aarch64__)
+#elif defined(__powerpc__) || defined(__sparc__) || defined(__arm__) || \
+ defined(__aarch64__) || defined(__loongarch__)
return PC + 4;
#else
return PC + 1;
More information about the llvm-commits
mailing list