source: src/CodeGen/FixMain.h@ c6b4432

stuck-waitfor-destruct
Last change on this file since c6b4432 was c6b4432, checked in by Andrew Beach <ajbeach@…>, 3 years ago

Remove BaseSyntaxNode and clean-up.

  • Property mode set to 100644
File size: 1.0 KB
RevLine 
[13de47bc]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 --
8//
9// Author : Thierry Delisle
10// Created On : Thr Jan 12 14:11:09 2017
[f42fc13]11// Last Modified By : Andrew Beach
[8e48fca4]12// Last Modified On : Fri Oct 29 16:20:00 2021
13// Update Count : 8
[13de47bc]14//
15
[6b0b624]16#pragma once
[13de47bc]17
18#include <iosfwd>
19#include <memory>
[f42fc13]20#include <list>
[13de47bc]21
[8941b6b]22#include "AST/LinkageSpec.hpp"
[13de47bc]23
[0c577f7]24namespace ast {
25 class FunctionDecl;
[bef4f1a]26 class TranslationUnit;
[0c577f7]27}
[13de47bc]28
29namespace CodeGen {
[0c577f7]30
[8e48fca4]31class FixMain {
32public :
[8941b6b]33 static inline ast::Linkage::Spec getMainLinkage() {
34 return replace_main ? ast::Linkage::Cforall : ast::Linkage::C;
35 }
[13de47bc]36
[8e48fca4]37 static inline void setReplaceMain(bool val) {
38 replace_main = val;
39 }
[13de47bc]40
[8e48fca4]41 static bool isMain(const ast::FunctionDecl * decl);
[13de47bc]42
[bef4f1a]43 static void fix( ast::TranslationUnit & translationUnit,
44 std::ostream &os, const char * bootloader_filename );
[8e48fca4]45
46private:
47 static bool replace_main;
48};
[f42fc13]49
[60a8062]50} // namespace CodeGen
Note: See TracBrowser for help on using the repository browser.