Page MenuHomePhabricator

DebugInfo: support for DW_TAG_atomic_type
ClosedPublic

Authored by vleschuk on Oct 31 2016, 5:37 AM.

Details

Summary

Mark C11 _Atomic variables with DW_TAG_atomic_type tag.

This is the simplest way to achieve the goal: modifying Qualifiers results in much more changes and putting emission of tag into CreateQualifiedType() along with DW_TAG_const_type and friends seems more logic but requires way more changes and could break something else (my first attempt to add atomic to qualifiers resulted in lots of failures in OpenCL tests for some reason).

Diff Detail

Repository
rL LLVM

Event Timeline

vleschuk updated this revision to Diff 76389.Oct 31 2016, 5:37 AM
vleschuk retitled this revision from to DebugInfo: support for DW_TAG_atomic_type.
vleschuk updated this object.
vleschuk added a subscriber: cfe-commits.
aprantl accepted this revision.Oct 31 2016, 8:58 AM
aprantl edited edge metadata.

LGTM with inline comments addressed.

test/CodeGen/debug-info-atomic.c
3 ↗(On Diff #76389)

Why do we need the const here?

4 ↗(On Diff #76389)

Can you check that it is actually the DIVariable "i" that has the atomic type?

This revision is now accepted and ready to land.Oct 31 2016, 8:58 AM
vleschuk added inline comments.Oct 31 2016, 10:11 AM
test/CodeGen/debug-info-atomic.c
3 ↗(On Diff #76389)

I thought it would be better to make sure that "enabling" atomic doesn't affect other qualifiers.

vleschuk marked 2 inline comments as done.Oct 31 2016, 10:11 AM
vleschuk updated this revision to Diff 76441.Oct 31 2016, 10:24 AM
vleschuk edited edge metadata.

Made test more strict: it now checks that variable i is atomic.

vleschuk marked an inline comment as done.Oct 31 2016, 10:24 AM

One more inline comment.

test/CodeGen/debug-info-atomic.c
4 ↗(On Diff #76441)

Please use FileCheck variables ![[TYPE:[0-9]+]] instead of hardcoding the numbers. This is bound to break soon otherwise.

This revision was automatically updated to reflect the committed changes.