This is an archive of the discontinued LLVM Phabricator instance.

Remove the old AddressDescription struct
AbandonedPublic

Authored by filcab on Sep 1 2016, 7:31 AM.

Details

Summary

Remove the struct since it's used only once. This removes one level of
indirection, and moves all *AddressDescription to be one of the recently
introduced structures.

Diff Detail

Event Timeline

filcab updated this revision to Diff 70006.Sep 1 2016, 7:31 AM
filcab retitled this revision from to Remove the old AddressDescription struct.
filcab updated this object.
filcab added reviewers: kcc, eugenis, vitalybuka.
filcab added a subscriber: llvm-commits.
vitalybuka requested changes to this revision.Sep 1 2016, 10:54 AM
vitalybuka edited edge metadata.
vitalybuka added inline comments.
lib/asan/asan_debugging.cc
82

could you avoid NOLINT with descr = {addr} ?

85

Could you please add:
const char *region_kind = nullptr;
name[0] = 0;

if any bug in switches below, it would be easiest to debug consistent values

86

what is going to happen if descr.kind is not one of your cases?

if it's impossible, CHECK in default: would be nice.

This revision now requires changes to proceed.Sep 1 2016, 10:54 AM
filcab updated this revision to Diff 70339.Sep 5 2016, 9:33 AM
filcab edited edge metadata.
filcab marked 2 inline comments as done.

Addressed code review comments

filcab updated this revision to Diff 70341.EditedSep 5 2016, 10:02 AM
filcab edited edge metadata.

Make sure name and name_size are !=0 and >0 respectively.

filcab abandoned this revision.Sep 7 2016, 7:10 AM

This revision got merged with D24131.

lib/asan/asan_debugging.cc
85

I usually avoid initializing when we cover all cases, as it makes it easier for msan to catch the uninitialized use.
But this sanitizer won't be built with MSan, so that defensive coding is a good thing to do. Thanks.

86

If we add the default case, we get a clang warning, though. I can add a check that we have one of those, before the switch, but it will end up ugly:

CHECK(descr.kind == kAddressKindWild || descr.kind == kAddressKindShadow || ...);

Should we also fix places like PrintHeapChunkAccess in asan_descriptions.cc, which does the same thing (not have a default case)?