LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
frontend.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Yeong-won Seo
3 *
4 * This file is part of LILAC.
5 *
6 * LILAC is free software: you can redistribute it and/or modify it under
7 * the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3, or (at your option) any later
9 * version.
10 *
11 * LILAC is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include "shared/frontend.h"
21
22static std::vector<lilac::shared::FrontendAction*> backends;
23
24
25lilac::shared::FrontendAction::FrontendAction(FrontendKind kind, std::string name, std::string desc)
26 : m_Name(std::move(name)), m_Desc(std::move(desc)), m_Kind(kind)
27{
28 backends.push_back(this);
29}
30
31const std::string& lilac::shared::FrontendAction::Name() const
32{
33 return m_Name;
34}
35
36const std::string& lilac::shared::FrontendAction::Desc() const
37{
38 return m_Desc;
39}
40
45
46const std::vector<lilac::shared::FrontendAction*>& lilac::shared::FrontendAction::GetRegistered()
47{
48 return backends;
49}
FrontendKind Kind() const
Gets the kind of this action.
Definition frontend.cxx:41
const std::string & Name() const
Gets the name of this action.
Definition frontend.cxx:31
FrontendAction(FrontendKind kind, std::string name, std::string desc)
Definition frontend.cxx:25
static const std::vector< FrontendAction * > & GetRegistered()
Gets all registered actions.
Definition frontend.cxx:46
const std::string & Desc() const
Gets the description of this action.
Definition frontend.cxx:36