AddressSanitizer depends on order of doFinalization

Hello All,

There is an issue in AddressSanitizer today because it depends on it's doFinalization method be called before the Printer method to output the final code (that is the printer runOnModule call). This assumption seems invalid as the doFinalization method should AFAIK only be used for clean up tasks independent of activities of other passes.

When I try to call doFinalization inside the MPPassManager::runOnModule method (to avoid changing the API to add doInitialization and doFinalization to the PassManager interface, as recommended by Chris) the assumption breaks as all the doFinalization methods will now be called after all the runOnModule or runOnFunction invocations.

Any comments/suggestions?


Pedro Artigas

Hi Pedro,

Looks like r168484 is the first step to remove ASan instrumentation from doFinalization().