[llvm] r241483 - [llvm-extract] Drop comdats from declarations

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Jul 6 15:50:35 PDT 2015


Thanks!
On Jul 6, 2015 2:51 PM, "Reid Kleckner" <reid at kleckner.net> wrote:

> Author: rnk
> Date: Mon Jul  6 13:48:02 2015
> New Revision: 241483
>
> URL: http://llvm.org/viewvc/llvm-project?rev=241483&view=rev
> Log:
> [llvm-extract] Drop comdats from declarations
>
> The verifier rejects comdats on declarations.
>
> Modified:
>     llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp
>     llvm/trunk/test/Other/extract.ll
>
> Modified: llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp?rev=241483&r1=241482&r2=241483&view=diff
>
> ==============================================================================
> --- llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp (original)
> +++ llvm/trunk/lib/Transforms/IPO/ExtractGV.cpp Mon Jul  6 13:48:02 2015
> @@ -93,8 +93,11 @@ namespace {
>
>          makeVisible(*I, Delete);
>
> -        if (Delete)
> +        if (Delete) {
> +          // Make this a declaration and drop it's comdat.
>            I->setInitializer(nullptr);
> +          I->setComdat(nullptr);
> +        }
>        }
>
>        // Visit the Functions.
> @@ -108,8 +111,11 @@ namespace {
>
>          makeVisible(*I, Delete);
>
> -        if (Delete)
> +        if (Delete) {
> +          // Make this a declaration and drop it's comdat.
>            I->deleteBody();
> +          I->setComdat(nullptr);
> +        }
>        }
>
>        // Visit the Aliases.
>
> Modified: llvm/trunk/test/Other/extract.ll
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Other/extract.ll?rev=241483&r1=241482&r2=241483&view=diff
>
> ==============================================================================
> --- llvm/trunk/test/Other/extract.ll (original)
> +++ llvm/trunk/test/Other/extract.ll Mon Jul  6 13:48:02 2015
> @@ -7,19 +7,22 @@
>  ; llvm-extract uses lazy bitcode loading, so make sure it correctly reads
>  ; from bitcode files in addition to assembly files.
>
> -; CHECK: define hidden void @foo() {
> +; CHECK: define hidden void @foo() comdat($x) {
>  ; CHECK:   ret void
>  ; CHECK: }
>
>  ; The private linkage for foo() should be changed to external linkage and
>  ; hidden visibility added.
>  ; DELETE: declare hidden void @foo()
> +; DELETE-NOT: comdat
>  ; DELETE: define void @bar() {
>  ; DELETE:   call void @foo()
>  ; DELETE:   ret void
>  ; DELETE: }
>
> -define private void @foo() {
> +$x = comdat any
> +
> +define private void @foo() comdat($x) {
>    ret void
>  }
>  define void @bar() {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150706/78f2b85e/attachment.html>


More information about the llvm-commits mailing list