Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/FixMain.h

    r60a8062 r8e48fca4  
    99// Author           : Thierry Delisle
    1010// Created On       : Thr Jan 12 14:11:09 2017
    11 // Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Feb 16 03:24:32 2020
    13 // Update Count     : 5
     11// Last Modified By : Andrew Beach
     12// Last Modified On : Fri Oct 29 16:20:00 2021
     13// Update Count     : 8
    1414//
    1515
     
    1818#include <iosfwd>
    1919#include <memory>
     20#include <list>
    2021
    2122#include "SynTree/LinkageSpec.h"
    2223
     24class Declaration;
    2325class FunctionDecl;
     26namespace ast {
     27        class FunctionDecl;
     28}
    2429
    2530namespace CodeGen {
    26         class FixMain {
    27           public :
    28                 static inline LinkageSpec::Spec mainLinkage() {
    29                         return replace_main ? LinkageSpec::Cforall : LinkageSpec::C;
    30                 }
    31                
    32                 static inline void setReplaceMain(bool val) {
    33                         replace_main = val;
    34                 }
    3531
    36                 static void registerMain(FunctionDecl* val);
     32class FixMain {
     33public :
     34        static inline LinkageSpec::Spec mainLinkage() {
     35                return replace_main ? LinkageSpec::Cforall : LinkageSpec::C;
     36        }
    3737
    38                 static void fix(std::ostream &os, const char* bootloader_filename);
     38        static inline void setReplaceMain(bool val) {
     39                replace_main = val;
     40        }
    3941
    40           private:
    41                 static bool replace_main;
    42                 static std::unique_ptr<FunctionDecl> main_signature;
    43         };
     42        static bool isMain(FunctionDecl* decl);
     43        static bool isMain(const ast::FunctionDecl * decl);
     44
     45        static void fix( std::list< Declaration * > & decls,
     46                        std::ostream &os, const char* bootloader_filename );
     47
     48private:
     49        static bool replace_main;
     50};
     51
    4452} // namespace CodeGen
Note: See TracChangeset for help on using the changeset viewer.