This patch introduces createUserspaceApi() that creates function/global declarations for symbols used by MSan in the userspace.
This is a step towards the upcoming KMSAN implementation patch.
Details
- Reviewers
eugenis vitalybuka kcc dvyukov
Diff Detail
Event Timeline
lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
596 | This should probably be a property of a module, not a compiler invocation. |
lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
596 | We used to check for WarningFn value here, and are just using a special bool instead now. |
lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
596 | Just consider that this bool can become true only once in the compiler process. No matter how many modules are created. Moving it to class MemorySanitizer sounds good. In fact, a FunctionPass is not supposed to create new functions (which AFAIK includes function declarations) outside of doInitialization(). MSan breaks this assumption in a bunch of places... |
lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
596 |
IIRC we don't do that in other tools either, do we?
Done
We only create getAndInsertFunction() from initializeCallbacks(). | |
596 |
s/create/call |
lib/Transforms/Instrumentation/MemorySanitizer.cpp | ||
---|---|---|
596 |
Do what?
Yes, but only if at least on function in the module has sanitize_memory attribute. |
This should probably be a property of a module, not a compiler invocation.