This is an archive of the discontinued LLVM Phabricator instance.

[esan] Add compilation unit init/exit routines.
ClosedPublic

Authored by zhaoqin on May 20 2016, 1:27 PM.

Details

Summary

Adds processCompilationUnitInit and processCompilationUnitExit
for compilation unit init/exit.

Adds a tool-specific argument passed to esan_init.

Adds the dtor and esan_exit called from the dtor.

Adds struct-simple.cpp for a multi-unit separate compilation test.

Diff Detail

Event Timeline

zhaoqin updated this revision to Diff 57981.May 20 2016, 1:27 PM
zhaoqin retitled this revision from to [esan] Add compilation unit init/exit routines..
zhaoqin updated this object.
zhaoqin added a reviewer: aizatsky.
zhaoqin added subscribers: llvm-commits, eugenis, vitalybuka and 2 others.
aizatsky edited edge metadata.May 20 2016, 1:36 PM

Does this CL miss something?

I do not see esan_exit calls.
Plus you probably need to add it to esan.syms?

zhaoqin updated this revision to Diff 57984.May 20 2016, 1:41 PM
zhaoqin edited edge metadata.

Update esan.syms.extra

aizatsky added inline comments.May 20 2016, 1:56 PM
lib/esan/esan.h
40

Document Ptr.

lib/esan/esan_interface.cpp
26

Do you want to pass Tool in as well?

Does this CL miss something?

I do not see esan_exit calls.

The calls is inserted from the ESan instrumentation at http://reviews.llvm.org/D20488

Plus you probably need to add it to esan.syms?

done

zhaoqin added inline comments.May 20 2016, 2:47 PM
lib/esan/esan_interface.cpp
26

the Tool is set to a global variable, so we do not need update it.

aizatsky accepted this revision.May 20 2016, 2:50 PM
aizatsky edited edge metadata.

Comment nit. LG otherwise.

lib/esan/esan.h
40

Should it be "variable per tool per compilation unit"?

This revision is now accepted and ready to land.May 20 2016, 2:50 PM
zhaoqin marked an inline comment as done.May 20 2016, 2:51 PM
zhaoqin updated this revision to Diff 58000.May 20 2016, 3:13 PM
zhaoqin edited edge metadata.

update comment for Ptr

zhaoqin updated this revision to Diff 58325.May 24 2016, 2:52 PM

Remove struct-simple.cpp to avoid test bot failure.

The correct CL landing order:
D20486: implement esan_exit
D20488: add calls to
esan_exit
Add test struct-simple.cpp: check printout from __esan_exit.

This revision was automatically updated to reflect the committed changes.

My apologies, I failed to add the "Patch by Qin Zhao" to the commit message.