ADT
arm-eh
ast-experimental
enum
forall-pointer-decay
jacob/cs343-translation
jenkins-sandbox
new-ast
new-ast-unique-expr
pthread-emulation
qualifiedEnum
Rev | Line | |
---|
[b87a5ed] | 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 | //
|
---|
[79970ed] | 7 | // LinkageSpec.cc --
|
---|
| 8 | //
|
---|
[b87a5ed] | 9 | // Author : Rodolfo G. Esteves
|
---|
| 10 | // Created On : Sat May 16 13:22:09 2015
|
---|
[d912bed] | 11 | // Last Modified By : Peter A. Buhr
|
---|
| 12 | // Last Modified On : Mon Dec 16 15:02:29 2019
|
---|
| 13 | // Update Count : 28
|
---|
[79970ed] | 14 | //
|
---|
[b87a5ed] | 15 |
|
---|
[51b73452] | 16 | #include <cassert>
|
---|
[d912bed] | 17 | #include <memory> // for unique_ptr
|
---|
| 18 | #include <string>
|
---|
[faddbd8] | 19 | using namespace std;
|
---|
[51b73452] | 20 |
|
---|
| 21 | #include "LinkageSpec.h"
|
---|
[d3b7937] | 22 | #include "Common/SemanticError.h"
|
---|
[51b73452] | 23 |
|
---|
[54d714e] | 24 | namespace LinkageSpec {
|
---|
[d912bed] | 25 | Spec update( CodeLocation location, Spec spec, const string * cmd ) {
|
---|
| 26 | assert( cmd );
|
---|
| 27 | unique_ptr<const string> guard( cmd ); // allocated by lexer
|
---|
| 28 | if ( *cmd == "\"Cforall\"" ) {
|
---|
| 29 | spec.is_mangled = true;
|
---|
| 30 | return spec;
|
---|
| 31 | } else if ( *cmd == "\"C\"" ) {
|
---|
| 32 | spec.is_mangled = false;
|
---|
| 33 | return spec;
|
---|
| 34 | } else {
|
---|
| 35 | SemanticError( location, "Invalid linkage specifier " + *cmd );
|
---|
| 36 | } // if
|
---|
| 37 | } // update
|
---|
[54d714e] | 38 |
|
---|
[d912bed] | 39 | string name( Spec spec ) {
|
---|
| 40 | switch ( spec ) {
|
---|
| 41 | case Intrinsic: return "intrinsic";
|
---|
| 42 | case C: return "C";
|
---|
| 43 | case Cforall: return "Cforall";
|
---|
| 44 | case AutoGen: return "autogenerated cfa";
|
---|
| 45 | case Compiler: return "compiler built-in";
|
---|
| 46 | case BuiltinCFA: return "cfa built-in";
|
---|
| 47 | case BuiltinC: return "c built-in";
|
---|
| 48 | default: return "<unnamed linkage spec>";
|
---|
| 49 | } // siwtch
|
---|
| 50 | } // name
|
---|
[54d714e] | 51 | } // LinkageSpec
|
---|
[b87a5ed] | 52 |
|
---|
| 53 | // Local Variables: //
|
---|
| 54 | // tab-width: 4 //
|
---|
| 55 | // mode: c++ //
|
---|
| 56 | // compile-command: "make install" //
|
---|
| 57 | // End: //
|
---|
Note:
See
TracBrowser
for help on using the repository browser.