This is an archive of the discontinued LLVM Phabricator instance.

[XRay] Guard local variables with `static` and struct with unnamed namespaces
ClosedPublic

Authored by MaskRay on Sep 27 2018, 6:03 PM.

Details

Summary

This is for coding standard conformance, and for fixing an ODR violation
issue: __xray::ThreadLocalData is defined twice and differently in
xray_fdr_logging.cc and xray_basic_logging.cc

Diff Detail

Repository
rL LLVM

Event Timeline

MaskRay created this revision.Sep 27 2018, 6:03 PM
Herald added subscribers: Restricted Project, llvm-commits, jfb, delcypher. · View Herald TranscriptSep 27 2018, 6:03 PM
MaskRay updated this revision to Diff 167421.Sep 27 2018, 6:05 PM

Guard another two structs

dberris accepted this revision.Sep 27 2018, 7:04 PM

LGTM -- thanks! Is there a way for us to catch these with tests?

This revision is now accepted and ready to land.Sep 27 2018, 7:04 PM
This revision was automatically updated to reflect the committed changes.

LGTM -- thanks! Is there a way for us to catch these with tests?

I'm not sure if ODRHash or other tools can catch this... This may not matter too much for a trivial type like this.. If it were virtual or had constructors, the linker would error.