Ignore:
Timestamp:
Nov 14, 2023, 12:19:09 PM (23 months ago)
Author:
caparson <caparson@…>
Branches:
master
Children:
1ccae59, 89a8bab
Parents:
df8ba61a (diff), 5625427 (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/CodeGen/FixMain.h

    rdf8ba61a r8d182b1  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FixMain.h --
     7// FixMain.h -- Tools to change a Cforall main into a C main.
    88//
    99// Author           : Thierry Delisle
     
    1717
    1818#include <iosfwd>
    19 #include <memory>
    20 #include <list>
    2119
    22 #include "AST/LinkageSpec.hpp"
    23 #include "SynTree/LinkageSpec.h"
    24 
    25 class Declaration;
    26 class FunctionDecl;
    2720namespace ast {
    2821        class FunctionDecl;
     
    3225namespace CodeGen {
    3326
    34 class FixMain {
    35 public :
    36         static inline LinkageSpec::Spec mainLinkage() {
    37                 return replace_main ? LinkageSpec::Cforall : LinkageSpec::C;
    38         }
    39         static inline ast::Linkage::Spec getMainLinkage() {
    40                 return replace_main ? ast::Linkage::Cforall : ast::Linkage::C;
    41         }
     27/// Is this function a program main function?
     28bool isMain( const ast::FunctionDecl * decl );
    4229
    43         static inline void setReplaceMain(bool val) {
    44                 replace_main = val;
    45         }
     30/// Adjust the linkage of main functions.
     31void fixMainLinkage( ast::TranslationUnit & transUnit, bool replaceMain );
    4632
    47         static bool isMain(FunctionDecl* decl);
    48         static bool isMain(const ast::FunctionDecl * decl);
    49 
    50         static void fix( std::list< Declaration * > & decls,
    51                         std::ostream &os, const char* bootloader_filename );
    52         static void fix( ast::TranslationUnit & translationUnit,
    53                         std::ostream &os, const char * bootloader_filename );
    54 
    55 private:
    56         static bool replace_main;
    57 };
     33/// Add a wrapper around to run the Cforall main.
     34void fixMainInvoke( ast::TranslationUnit & transUnit,
     35                std::ostream & os, const char * bootloaderFilename );
    5836
    5937} // namespace CodeGen
Note: See TracChangeset for help on using the changeset viewer.