On Tue, Jan 8, 2013 at 7:39 PM, Will Dietz <[email protected]> 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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to