| 
            Last change
 on this file since 58e2ce34 was             61efa42, checked in by Andrew Beach <ajbeach@…>, 2 years ago           | 
        
        
          | 
             
Took the special main linkage code out of FunctionDecl and put it into a new pass. There is also a lot of related clean-up done. 
 
           | 
        
        
          
            
              - 
Property                 mode
 set to                 
100644
               
             
           | 
        
        
          | 
            File size:
            970 bytes
           | 
        
      
      
| 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 -- Tools to change a Cforall main into a C main.
 | 
|---|
| 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 16:20:00 2021
 | 
|---|
| 13 | // Update Count     : 8
 | 
|---|
| 14 | //
 | 
|---|
| 15 | 
 | 
|---|
| 16 | #pragma once
 | 
|---|
| 17 | 
 | 
|---|
| 18 | #include <iosfwd>
 | 
|---|
| 19 | 
 | 
|---|
| 20 | namespace ast {
 | 
|---|
| 21 |         class FunctionDecl;
 | 
|---|
| 22 |         class TranslationUnit;
 | 
|---|
| 23 | }
 | 
|---|
| 24 | 
 | 
|---|
| 25 | namespace CodeGen {
 | 
|---|
| 26 | 
 | 
|---|
| 27 | /// Is this function a program main function?
 | 
|---|
| 28 | bool isMain( const ast::FunctionDecl * decl );
 | 
|---|
| 29 | 
 | 
|---|
| 30 | /// Adjust the linkage of main functions.
 | 
|---|
| 31 | void fixMainLinkage( ast::TranslationUnit & transUnit, bool replaceMain );
 | 
|---|
| 32 | 
 | 
|---|
| 33 | /// Add a wrapper around to run the Cforall main.
 | 
|---|
| 34 | void fixMainInvoke( ast::TranslationUnit & transUnit,
 | 
|---|
| 35 |                 std::ostream & os, const char * bootloaderFilename );
 | 
|---|
| 36 | 
 | 
|---|
| 37 | } // namespace CodeGen
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.