[llvm-commits] [llvm] r120498 - in /llvm/trunk: lib/Transforms/Scalar/DeadStoreElimination.cpp test/Transforms/DeadStoreElimination/PartialStore.ll
Chris Lattner
clattner at apple.com
Mon Dec 6 13:50:40 PST 2010
On Dec 1, 2010, at 12:09 AM, Duncan Sands wrote:
>>
>>
>> +/// isObjectPointerWithTrustworthySize - Return true if the specified Value* is
>> +/// pointing to an object with a pointer size we can trust.
>> +static bool isObjectPointerWithTrustworthySize(const Value *V) {
>> + if (const AllocaInst *AI = dyn_cast<AllocaInst>(V))
>> + return !AI->isArrayAllocation();
>> + if (const GlobalVariable *GV = dyn_cast<GlobalVariable>(V))
>> + return !GV->isWeakForLinker();
>
> this should be mayBeOverridden not isWeakForLinker. That way globals with
> weak ODR linkage will be considered to have a trustworthy size. By the way
> isWeakForLinker should really be moved somewhere where people can't get at
> it, like the linker for example.
Great point, fixed in r121040, thanks for the review!
-Chris
More information about the llvm-commits
mailing list