[PATCH] D28589: [asan] Refactor instrumentation of globals.
Peter Collingbourne via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 12:03:04 PST 2017
pcc added inline comments.
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1621-1628
+ unsigned SizeOfGlobalStruct = DL.getTypeAllocSize(Initializer->getType());
+ assert(isPowerOf2_32(SizeOfGlobalStruct) &&
+ "global metadata will not be padded appropriately");
+
+ // The MSVC linker always inserts padding when linking incrementally. We
+ // cope with that by aligning each struct to its size, which must be a power
+ // of two.
----------------
eugenis wrote:
> pcc wrote:
> > eugenis wrote:
> > > pcc wrote:
> > > > I guess we can move this part into `InstrumentGlobalsCOFF` as a separate functional change.
> > > Actually this is not COFF-specific. See https://reviews.llvm.org/D28573. The comment update got lost somehow.
> > Can you please update the comment, then?
> I think I've done that.
The way the comment is currently worded, it seems to be about just MSVC. I would explain why the alignment is needed in the first sentence, and reword the second sentence to something like "Also, the MSVC linker..."
Repository:
rL LLVM
https://reviews.llvm.org/D28589
More information about the llvm-commits
mailing list