At compile-time, create an array of {PC,HumanReadableStackFrameDescription}
for every function that has an instrumented frame, and pass this array
to the run-time at the module-init time.
Similar to how we handle pc-table in SanitizerCoverage.
The run-time is dummy, will add the actual logic in later commits.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | ||
---|---|---|
151 ↗ | (On Diff #169518) | s/_/- |
217 ↗ | (On Diff #169518) | "fd" usually stands for file descriptor |
319 ↗ | (On Diff #169518) | This section should be read-only so the (intrusive) linked list idea would not work. I don't think this slot helps you avoid a module pass. You can create a call to __hwasan_init_fd regardless. You are inserting multiple calls to __hwasan_init_fd to the ctor function. Just one would be enough. Ctor function should be comdat'ed itself, but that's orthogonal. |
742 ↗ | (On Diff #169518) | Why would F's name start with "hwasan"? Did you mean "__hwasan"? |
addressed review comments
lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | ||
---|---|---|
151 ↗ | (On Diff #169518) | done. |
217 ↗ | (On Diff #169518) | renamed the section to hwasan_frames and the callback to hwasan_init_frames |
319 ↗ | (On Diff #169518) | Ok, won't use the (intrusive) linked list.
Nope. This code is in HWAddressSanitizer::doInitialization(Module &M)
Yep, will do separately. |
742 ↗ | (On Diff #169518) | No, this one is for the CTOR (HwasanCtorFunction above) |
lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | ||
---|---|---|
318 ↗ | (On Diff #169529) | Why do we need a frame description for the ctor in order to call it? |
lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | ||
---|---|---|
318 ↗ | (On Diff #169529) | We don't. |
lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | ||
---|---|---|
742 ↗ | (On Diff #169518) | Why not compare F with HwasanCtorFunction? |
address one more comment
lib/Transforms/Instrumentation/HWAddressSanitizer.cpp | ||
---|---|---|
742 ↗ | (On Diff #169518) | Yep, done. |