This is an archive of the discontinued LLVM Phabricator instance.

[nfc] [hwasan] factor out logic to collect info about stack
ClosedPublic

Authored by fmayer on Feb 3 2022, 2:24 PM.

Details

Summary

this is the first step in unifying some of the logic between hwasan and
mte stack tagging. this only moves around code, changes to converge
different implementations of the same logic follow later.

Diff Detail

Event Timeline

fmayer created this revision.Feb 3 2022, 2:24 PM
fmayer published this revision for review.Feb 3 2022, 2:32 PM
fmayer added a reviewer: eugenis.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2022, 2:32 PM

Friendly ping, what do you think about this?

eugenis added inline comments.Feb 10 2022, 2:40 PM
llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
75

Let us not be the first to define "AllocaInfo" in namespace llvm. There are already two others but fortunately they are wrapped in an anonymous namespace. StackInfo is very generic, too.

Maybe call it StackTaggingInfo or StackInstrumentationInfo and make AllocaInfo its inner class?
Or move everything to namespace memtag or something.

84

This can be part of AllocaInfo (not necessarily in this change). We also do not need to collect these for uninteresting allocas I think.

104

Can we just pass an std::function? This delegate stuff feels very heavy handed.

fmayer updated this revision to Diff 407697.Feb 10 2022, 3:16 PM
fmayer marked 3 inline comments as done.

address comments

llvm/include/llvm/Transforms/Utils/MemoryTaggingSupport.h
84

Yes, that is the plan. But I want to keep this change as trivially NFC as possible.

104

Makes sense, we can revisit the delegate if we get more than one callback and it gets messy like this.

This revision is now accepted and ready to land.Feb 11 2022, 10:08 AM
This revision was landed with ongoing or failed builds.Feb 11 2022, 10:54 AM
This revision was automatically updated to reflect the committed changes.