[PATCH] D29104: Add !associated metadata.

Evgenii Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 14:28:07 PST 2017


On Fri, Feb 17, 2017 at 5:17 AM, Rafael Avila de Espindola
<rafael.espindola at gmail.com> wrote:
> Evgeniy Stepanov via Phabricator <reviews at reviews.llvm.org> writes:
>
>> +; RUN: llc -data-sections=1 -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s --check-prefix=ASM
>> +; RUN: llc -data-sections=0 -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s --check-prefix=ASM
>> +
>> +; RUN: llc -data-sections=1 -mtriple x86_64-pc-linux-gnu -filetype=obj < %s | llvm-readobj -sections | FileCheck %s --check-prefixes=OBJ,OBJ1
>> +; RUN: llc -data-sections=0 -mtriple x86_64-pc-linux-gnu -filetype=obj < %s | llvm-readobj -sections | FileCheck %s --check-prefixes=OBJ,OBJ0
>
> Do you really need to test with "llc -filetype=obj"?

You are right, this is unnecessary.

>
>> + at a = global i32 1
>> + at b = global i32 2, !associated !0
>> +!0 = !{i32* @a}
>> +; ASM-DAG: .section .data.b,"awm", at progbits,a
>
> Is that what you want? This marks .data.b as a metadata section.

Yes, I think so. @b = global i32 2, !associated !0 means @b is
metadata for @a, not the other way around.


More information about the llvm-commits mailing list