Ignore:
Timestamp:
May 10, 2019, 12:09:05 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
9131e54, cdcd53dc
Parents:
292d599 (diff), 14cebb7a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/LinkageSpec.cpp

    r292d599 r36354b1  
    2424
    2525namespace ast {
    26         namespace Linkage {
    27                 Spec update( CodeLocation loc, Spec spec, const std::string * cmd ) {
    28                         assert( cmd );
    29                         std::unique_ptr<const std::string> guard( cmd ); // allocated by lexer
    30                         if ( *cmd == "\"Cforall\"" ) {
    31                                 spec.is_mangled = true;
    32                                 return spec;
    33                         } else if ( *cmd == "\"C\"" ) {
    34                                 spec.is_mangled = false;
    35                                 return spec;
    36                         } else {
    37                                 SemanticError( loc, "Invalid linkage specifier " + *cmd );
    38                         }
     26
     27namespace Linkage {
     28
     29        Spec update( CodeLocation loc, Spec spec, const std::string * cmd ) {
     30                assert( cmd );
     31                std::unique_ptr<const std::string> guard( cmd ); // allocated by lexer
     32                if ( *cmd == "\"Cforall\"" ) {
     33                        spec.is_mangled = true;
     34                        return spec;
     35                } else if ( *cmd == "\"C\"" ) {
     36                        spec.is_mangled = false;
     37                        return spec;
     38                } else {
     39                        SemanticError( loc, "Invalid linkage specifier " + *cmd );
    3940                }
    40        
     41        }
    4142
    42                 std::string name( Spec spec ) {
    43                         switch ( spec ) {
    44                         case Intrinsic:  return "intrinsic";
    45                         case C:          return "C";
    46                         case Cforall:    return "Cforall";
    47                         case AutoGen:    return "autogenerated cfa";
    48                         case Compiler:   return "compiler built-in";
    49                         case BuiltinCFA: return "cfa built-in";
    50                         case BuiltinC:   return "c built-in";
    51                         default:         return "<unnamed linkage spec>";
    52                         }
     43
     44        std::string name( Spec spec ) {
     45                switch ( spec ) {
     46                case Intrinsic:  return "intrinsic";
     47                case C:          return "C";
     48                case Cforall:    return "Cforall";
     49                case AutoGen:    return "autogenerated cfa";
     50                case Compiler:   return "compiler built-in";
     51                case BuiltinCFA: return "cfa built-in";
     52                case BuiltinC:   return "c built-in";
     53                default:         return "<unnamed linkage spec>";
    5354                }
     55        }
    5456
    55         }
     57}
     58
    5659}
    5760
Note: See TracChangeset for help on using the changeset viewer.