ADTast-experimentalpthread-emulation
Last change
on this file since f403c46 was
ed9a1ae,
checked in by Thierry Delisle <tdelisle@…>, 2 years ago
|
Cfa now distinguishes between thread and _Thread_local.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[2bb4a01] | 1 | // |
---|
| 2 | // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo |
---|
| 3 | // |
---|
| 4 | // The contents of this file are covered under the licence agreement in the |
---|
| 5 | // file "LICENCE" distributed with Cforall. |
---|
| 6 | // |
---|
| 7 | // StorageClasses.hpp -- |
---|
| 8 | // |
---|
| 9 | // Author : Aaron B. Moss |
---|
| 10 | // Created On : Thu May 9 10:00:00 2019 |
---|
| 11 | // Last Modified By : Aaron B. Moss |
---|
| 12 | // Last Modified On : Thu May 9 10:00:00 2019 |
---|
| 13 | // Update Count : 1 |
---|
| 14 | // |
---|
| 15 | |
---|
| 16 | #pragma once |
---|
| 17 | |
---|
| 18 | #include "Bitfield.hpp" |
---|
| 19 | |
---|
| 20 | namespace ast { |
---|
| 21 | |
---|
[a300e4a] | 22 | namespace Storage { |
---|
| 23 | |
---|
| 24 | /// Bitflags for storage classes |
---|
| 25 | enum { |
---|
[ed9a1ae] | 26 | Extern = 1 << 0, |
---|
| 27 | Static = 1 << 1, |
---|
| 28 | Auto = 1 << 2, |
---|
| 29 | Register = 1 << 3, |
---|
| 30 | ThreadLocalGcc = 1 << 4, |
---|
| 31 | ThreadLocalC11 = 1 << 5, |
---|
| 32 | NumClasses = 6 |
---|
[a300e4a] | 33 | }; |
---|
| 34 | |
---|
| 35 | /// Bitflag type for storage classes |
---|
[7f3f63c] | 36 | struct class_flags { |
---|
| 37 | union { |
---|
| 38 | unsigned int val; |
---|
| 39 | struct { |
---|
[ed9a1ae] | 40 | bool is_extern : 1; |
---|
| 41 | bool is_static : 1; |
---|
| 42 | bool is_auto : 1; |
---|
| 43 | bool is_register : 1; |
---|
| 44 | bool is_threadlocalGcc : 1; |
---|
| 45 | bool is_threadlocalC11 : 1; |
---|
[7f3f63c] | 46 | }; |
---|
| 47 | |
---|
| 48 | // MakeBitfieldPrint( NumClasses ) |
---|
[2bb4a01] | 49 | }; |
---|
| 50 | |
---|
[9e1d485] | 51 | constexpr class_flags( unsigned int val = 0 ) : val(val) {} |
---|
[ed9a1ae] | 52 | |
---|
| 53 | bool is_threadlocal_any() { return this->is_threadlocalC11 || this->is_threadlocalGcc; } |
---|
[a300e4a] | 54 | }; |
---|
[2bb4a01] | 55 | |
---|
[7f3f63c] | 56 | using Classes = bitfield<class_flags>; |
---|
[a300e4a] | 57 | } |
---|
[2bb4a01] | 58 | } |
---|
| 59 | |
---|
| 60 | // Local Variables: // |
---|
| 61 | // tab-width: 4 // |
---|
| 62 | // mode: c++ // |
---|
| 63 | // compile-command: "make install" // |
---|
| 64 | // End: // |
---|
Note: See
TracBrowser
for help on using the repository browser.