ADT
        ast-experimental
        enum
        forall-pointer-decay
        jacob/cs343-translation
        new-ast-unique-expr
        pthread-emulation
        qualifiedEnum
      
      
        
          | 
            Last change
 on this file since 8519fac was             9e1d485, checked in by Aaron Moss <a3moss@…>, 6 years ago           | 
        
        
          | 
             
First draft of ast::Type with subclasses 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            1.0 KB
           | 
        
      
      
| Line |   | 
|---|
| 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 | // FunctionSpec.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 | 
 | 
|---|
| 22 | namespace Function {
 | 
|---|
| 23 | 
 | 
|---|
| 24 |         /// Bitflags for function specifiers
 | 
|---|
| 25 |         enum {
 | 
|---|
| 26 |                 Inline   = 1 << 0,
 | 
|---|
| 27 |                 Noreturn = 1 << 1,
 | 
|---|
| 28 |                 Fortran  = 1 << 2,
 | 
|---|
| 29 |                 NumSpecs      = 3
 | 
|---|
| 30 |         };
 | 
|---|
| 31 | 
 | 
|---|
| 32 |         /// Bitflag type for storage classes
 | 
|---|
| 33 |         struct spec_flags {
 | 
|---|
| 34 |                 union {
 | 
|---|
| 35 |                         unsigned int val;
 | 
|---|
| 36 |                         struct {
 | 
|---|
| 37 |                                 bool is_inline   : 1;
 | 
|---|
| 38 |                                 bool is_noreturn : 1;
 | 
|---|
| 39 |                                 bool is_fortran  : 1;
 | 
|---|
| 40 |                         };
 | 
|---|
| 41 | 
 | 
|---|
| 42 |                         // MakeBitfieldPrint( NumSpecs )
 | 
|---|
| 43 |                 };
 | 
|---|
| 44 | 
 | 
|---|
| 45 |                 constexpr spec_flags( unsigned int val = 0 ) : val(val) {}
 | 
|---|
| 46 |         };
 | 
|---|
| 47 | 
 | 
|---|
| 48 |         using Specs = bitfield<spec_flags>;
 | 
|---|
| 49 | }
 | 
|---|
| 50 | }
 | 
|---|
| 51 | 
 | 
|---|
| 52 | // Local Variables: //
 | 
|---|
| 53 | // tab-width: 4 //
 | 
|---|
| 54 | // mode: c++ //
 | 
|---|
| 55 | // compile-command: "make install" //
 | 
|---|
| 56 | // End: //
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.