Changeset 8941b6b for src/AST


Ignore:
Timestamp:
Oct 25, 2023, 6:33:25 PM (15 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
bef4f1a
Parents:
d22bf87
Message:

Direct translation of code generation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.cpp

    rd22bf87 r8941b6b  
    2020#include <unordered_map>
    2121
     22#include "CodeGen/FixMain.h"   // for FixMain
    2223#include "Common/Eval.h"       // for eval
    2324
     
    7576        }
    7677        this->type = ftype;
     78        // Hack forcing the function "main" to have Cforall linkage to replace
     79        // main even if it is inside an extern "C", and also makes sure the
     80        // replacing function is always a C function.
     81        if ( name == "main" ) {
     82                this->linkage = CodeGen::FixMain::getMainLinkage();
     83        }
    7784}
    7885
     
    101108        }
    102109        this->type = type;
     110        // See note above about this hack.
     111        if ( name == "main" ) {
     112                this->linkage = CodeGen::FixMain::getMainLinkage();
     113        }
    103114}
    104115
Note: See TracChangeset for help on using the changeset viewer.