source: src/CodeGen/FixMain.h @ 0c577f7

ADTast-experimentalenumforall-pointer-decaypthread-emulationqualifiedEnum
Last change on this file since 0c577f7 was 0c577f7, checked in by Andrew Beach <ajbeach@…>, 2 years ago

Implemented new AST version of the Fix Names pass.

  • Property mode set to 100644
File size: 1.2 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// FixMain.h --
8//
9// Author           : Thierry Delisle
10// Created On       : Thr Jan 12 14:11:09 2017
11// Last Modified By : Andrew Beach
12// Last Modified On : Fri Oct 29 14:49:00 2021
13// Update Count     : 7
14//
15
16#pragma once
17
18#include <iosfwd>
19#include <memory>
20#include <list>
21
22#include "SynTree/LinkageSpec.h"
23
24class Declaration;
25class FunctionDecl;
26namespace ast {
27        class FunctionDecl;
28}
29
30namespace CodeGen {
31        class FixMain {
32          public :
33                static inline LinkageSpec::Spec mainLinkage() {
34                        return replace_main ? LinkageSpec::Cforall : LinkageSpec::C;
35                }
36
37                static inline void setReplaceMain(bool val) {
38                        replace_main = val;
39                }
40
41                static void registerMain(FunctionDecl* val);
42                static bool isMain(FunctionDecl* decl);
43                static bool isMain(const ast::FunctionDecl * decl);
44
45                static void fix(std::ostream &os, const char* bootloader_filename);
46
47                static void findMain( std::list< Declaration * > & decls );
48
49          private:
50                static bool replace_main;
51                static std::unique_ptr<FunctionDecl> main_signature;
52        };
53} // namespace CodeGen
Note: See TracBrowser for help on using the repository browser.