LLVM Discussion Forums

AddressSanitizer instrumentation as a function

I want to extract AddressSanitizer instrumentation as an independent function(or procedure)in assemble language or LLVM IR so I can call this function many times instead of instrumenting a lot of similar code if there is a lot of memory access code.
I read source code AddressSanitizer.cpp in llvm but I have no clue implement what I need at all.Any tips or guidance?图片1
For example, a use-after-free case is up there,and I want to extract instrcumentation as a function called .func1 (it has its own argments) to call it lot of time.