Changes in src/CodeGen/FixMain.h [61efa42:c6b4432]
- File:
-
- 1 edited
-
src/CodeGen/FixMain.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/FixMain.h
r61efa42 rc6b4432 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // FixMain.h -- Tools to change a Cforall main into a C main.7 // FixMain.h -- 8 8 // 9 9 // Author : Thierry Delisle … … 17 17 18 18 #include <iosfwd> 19 #include <memory> 20 #include <list> 21 22 #include "AST/LinkageSpec.hpp" 19 23 20 24 namespace ast { … … 25 29 namespace CodeGen { 26 30 27 /// Is this function a program main function? 28 bool isMain( const ast::FunctionDecl * decl ); 31 class FixMain { 32 public : 33 static inline ast::Linkage::Spec getMainLinkage() { 34 return replace_main ? ast::Linkage::Cforall : ast::Linkage::C; 35 } 29 36 30 /// Adjust the linkage of main functions. 31 void fixMainLinkage( ast::TranslationUnit & transUnit, bool replaceMain ); 37 static inline void setReplaceMain(bool val) { 38 replace_main = val; 39 } 32 40 33 /// Add a wrapper around to run the Cforall main. 34 void fixMainInvoke( ast::TranslationUnit & transUnit, 35 std::ostream & os, const char * bootloaderFilename ); 41 static bool isMain(const ast::FunctionDecl * decl); 42 43 static void fix( ast::TranslationUnit & translationUnit, 44 std::ostream &os, const char * bootloader_filename ); 45 46 private: 47 static bool replace_main; 48 }; 36 49 37 50 } // namespace CodeGen
Note:
See TracChangeset
for help on using the changeset viewer.