[cfe-commits] r171947 - in /cfe/trunk: lib/CodeGen/CGExpr.cpp test/CodeGen/catch-undef-behavior.c test/CodeGen/compound-assign-overflow.c
Eli Friedman
eli.friedman at gmail.com
Tue Jan 8 19:46:58 PST 2013
On Tue, Jan 8, 2013 at 7:39 PM, Will Dietz <wdietz2 at illinois.edu> wrote:
> Author: wdietz2
> Date: Tue Jan 8 21:39:41 2013
> New Revision: 171947
>
> URL: http://llvm.org/viewvc/llvm-project?rev=171947&view=rev
> Log:
> [ubsan] Make static check data non-const so it can be used for deduplication.
>
> Modified:
> cfe/trunk/lib/CodeGen/CGExpr.cpp
> cfe/trunk/test/CodeGen/catch-undef-behavior.c
> cfe/trunk/test/CodeGen/compound-assign-overflow.c
>
> Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=171947&r1=171946&r2=171947&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Tue Jan 8 21:39:41 2013
> @@ -1992,7 +1992,7 @@
>
> llvm::Constant *Info = llvm::ConstantStruct::getAnon(StaticArgs);
> llvm::GlobalValue *InfoPtr =
> - new llvm::GlobalVariable(CGM.getModule(), Info->getType(), true,
> + new llvm::GlobalVariable(CGM.getModule(), Info->getType(), false,
> llvm::GlobalVariable::PrivateLinkage, Info);
> InfoPtr->setUnnamedAddr(true);
If you want the address to be unique, just get rid of the
setUnnamedAddr() call... no need to fiddle with the const-ness.
-Eli
More information about the cfe-commits
mailing list