[llvm] [BOLT][RISCV] Implement basic instrumentation (PR #71664)

Job Noorman via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 00:23:14 PST 2023


================
@@ -0,0 +1,94 @@
+#ifndef LLVM_TOOLS_LLVM_BOLT_SYS_RISCV64
+#define LLVM_TOOLS_LLVM_BOLT_SYS_RISCV64
+
+#include <dirent.h>
----------------
mtvec wrote:

> But since we're not there yet, I'd stick with hard-coded definitions for syscall numbers.

I feel like I'm missing the problem we're trying to solve here. It seems to me this would only be useful in a situation where the user does have a (cross-) compiler available for the target (otherwise they couldn't compile the instrumentation library) but somehow does not have those system headers available. Is this a realistic scenario? I don't think I have ever seen a toolchain in the wild that doesn't ship those headers.

I also just noticed that `runtime/common.h` includes `cstddef` and `cstdint` so we are already relying on the toolchain to provide certain headers.

https://github.com/llvm/llvm-project/pull/71664


More information about the llvm-commits mailing list