[PATCH] D18109: Prevent GlobalOpts from dropping ASANitized global variables

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 11 16:18:27 PST 2016


aprantl created this revision.
aprantl added reviewers: dblaikie, samsonov, dexonsmith, echristo.
aprantl added a subscriber: llvm-commits.
aprantl set the repository for this revision to rL LLVM.

ASAN transforms global variables into an array with extra storage at the end and RAUWs the global value with a GEP into the array. GlobalOpts will think that the GEP constexpr is dead because its only use is a Metadata node and eliminate it, thus dropping the storage from the debug info.
This patch fixes this by adding a flag to Constant::removeDeadConstantUsers() to optionally ignore metadata users.

Repository:
  rL LLVM

http://reviews.llvm.org/D18109

Files:
  include/llvm/IR/Constant.h
  lib/IR/Constants.cpp
  lib/Transforms/IPO/GlobalOpt.cpp
  test/Transforms/GlobalOpt/debug-info-global-vars.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18109.50480.patch
Type: text/x-patch
Size: 4540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160312/66b27604/attachment.bin>


More information about the llvm-commits mailing list