LILAC
Language to language Interop LAyer Compiler
Loading...
Searching...
No Matches
exception.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/exception.h"
21
22#include <llvm/Support/raw_ostream.h>
23
24lilac::shared::exception::exception(std::string msg, const frxml::dom& dom) noexcept
25 : m_DOM(dom), m_Message(std::move(msg))
26{
27}
28
29const char* lilac::shared::exception::what() const noexcept
30{
31 return m_Message.c_str();
32}
33
35{
36 llvm::errs() << m_Message << '\n';
37}
38
39void lilac::shared::exception::print(const frxml::dom& location) const
40{
41 llvm::errs()
42 << m_Message
43 << "\n=== XML DUMP ===\n"
44 << frxml::doc{ location }
45 << "=== END DUMP ===\n";
46}
const char * what() const noexcept override
Definition exception.cxx:29
exception(std::string msg, const frxml::dom &dom) noexcept
Definition exception.cxx:24