DWARF Standard


HOME
SPECIFICATIONS
FAQ
ISSUES



131112.1 Joseph Myers Add DW_TAG_atomic_type for C11 _Atomic Enhancement Accepted Michael Eager


Section 5.2, pg 81

Background: 

ISO C11 adds the type qualifier _Atomic.  DW_TAG_atomic_type should be added 
to describe this in DWARF, analogously to the existing tags for const, 
volatile and restrict.

Discussion:

ISO C11 creates a new qualifier _Atomic which can be used in the same context
as const, volatile, and restric qualifiers.  This means that the _Atomic qualifier
can be used in a way which is order dependant, similar to the use of volatile
or const:

   volatile int const * hwaddr = 0x1234;

Presumably, one could write the following:

   volatile _Atomic int const _Atomic * hwaddr = 0x1234;

To insure that access to the pointer (hwaddr) and the object it points to 
are both access atomically.

Proposed changes:

Pg 8: Table 2.1: Tag names

  Add DW_TAG_atomic_type

Pg 87: Table 5.3: Type modifier tags

  Add DW_TAG_atomic_type	C atomic qualified type

Pg 157: Table 7.1: Tag encodings

  Add DW_TAG_atomic_type	0x47

Appendix A: Table A.1: Attributes by tag value
  Add following:

  DW_TAG_atomic_type 	DW_AT_allocated
			DW_AT_associated
			DW_AT_data_location
			DW_AT_name
			DW_AT_sibling

  Note:  This is adapted from DW_TAG_const_type, etc.  Is it reasonable
         to have a name or location associated with any of these TAGs?
	 These attribute would be on the variable DIE, not the type.

---
Accepted 12/17/2013


All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2007-2017 by DWARF Standards Committee.