source:
src/CodeGen/FixMain.h
@
18f7858
Last change on this file since 18f7858 was 8e48fca4, checked in by , 3 years ago | |
---|---|
|
|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[13de47bc] | 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 | // FixMain.h -- | |
8 | // | |
9 | // Author : Thierry Delisle | |
10 | // Created On : Thr Jan 12 14:11:09 2017 | |
[f42fc13] | 11 | // Last Modified By : Andrew Beach |
[8e48fca4] | 12 | // Last Modified On : Fri Oct 29 16:20:00 2021 |
13 | // Update Count : 8 | |
[13de47bc] | 14 | // |
15 | ||
[6b0b624] | 16 | #pragma once |
[13de47bc] | 17 | |
18 | #include <iosfwd> | |
19 | #include <memory> | |
[f42fc13] | 20 | #include <list> |
[13de47bc] | 21 | |
[07de76b] | 22 | #include "SynTree/LinkageSpec.h" |
[13de47bc] | 23 | |
[f42fc13] | 24 | class Declaration; |
[13de47bc] | 25 | class FunctionDecl; |
[0c577f7] | 26 | namespace ast { |
27 | class FunctionDecl; | |
28 | } | |
[13de47bc] | 29 | |
30 | namespace CodeGen { | |
[0c577f7] | 31 | |
[8e48fca4] | 32 | class FixMain { |
33 | public : | |
34 | static inline LinkageSpec::Spec mainLinkage() { | |
35 | return replace_main ? LinkageSpec::Cforall : LinkageSpec::C; | |
36 | } | |
[13de47bc] | 37 | |
[8e48fca4] | 38 | static inline void setReplaceMain(bool val) { |
39 | replace_main = val; | |
40 | } | |
[13de47bc] | 41 | |
[8e48fca4] | 42 | static bool isMain(FunctionDecl* decl); |
43 | static bool isMain(const ast::FunctionDecl * decl); | |
[13de47bc] | 44 | |
[8e48fca4] | 45 | static void fix( std::list< Declaration * > & decls, |
46 | std::ostream &os, const char* bootloader_filename ); | |
47 | ||
48 | private: | |
49 | static bool replace_main; | |
50 | }; | |
[f42fc13] | 51 | |
[60a8062] | 52 | } // namespace CodeGen |
Note: See TracBrowser
for help on using the repository browser.