Changes in src/CodeGen/FixMain.h [61efa42:8e48fca4]
- File:
-
- 1 edited
-
src/CodeGen/FixMain.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/FixMain.h
r61efa42 r8e48fca4 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> 19 21 22 #include "SynTree/LinkageSpec.h" 23 24 class Declaration; 25 class FunctionDecl; 20 26 namespace ast { 21 27 class FunctionDecl; 22 class TranslationUnit;23 28 } 24 29 25 30 namespace CodeGen { 26 31 27 /// Is this function a program main function? 28 bool isMain( const ast::FunctionDecl * decl ); 32 class FixMain { 33 public : 34 static inline LinkageSpec::Spec mainLinkage() { 35 return replace_main ? LinkageSpec::Cforall : LinkageSpec::C; 36 } 29 37 30 /// Adjust the linkage of main functions. 31 void fixMainLinkage( ast::TranslationUnit & transUnit, bool replaceMain ); 38 static inline void setReplaceMain(bool val) { 39 replace_main = val; 40 } 32 41 33 /// Add a wrapper around to run the Cforall main. 34 void fixMainInvoke( ast::TranslationUnit & transUnit, 35 std::ostream & os, const char * bootloaderFilename ); 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 48 private: 49 static bool replace_main; 50 }; 36 51 37 52 } // namespace CodeGen
Note:
See TracChangeset
for help on using the changeset viewer.