Yume
Namespaces | Classes | Concepts | Typedefs | Enumerations | Functions | Variables
yume Namespace Reference

Namespaces

namespace  ast
 
namespace  diagnostic
 
namespace  mangle
 
namespace  semantic
 
namespace  ty
 

Classes

struct  ASTStackTrace
 
class  Atom
 Atoms represent strings in a string pool. More...
 
class  Compiler
 The Compiler the the primary top-level type during compilation. A single instance is created during the compilation process. More...
 
struct  Const
 A constant declaration in the compiler. More...
 
struct  CRTPWalker
 A helper template to walk the Abstract Syntax Tree (AST), utilizing the Curiously Recurring Template Pattern (CRTP). More...
 
struct  DeclLike
 A common base between declarations in the compiler: Fn, Struct and Const. Its value may also be absent (std::monostate). More...
 
struct  Def
 
struct  Fn
 A function declaration in the compiler. More...
 
struct  FnArg
 
struct  GenericKey
 
struct  GenericValue
 
struct  InScope
 A local variable in function scope. Used to track destructing when the scope ends. More...
 
struct  Loc
 Represents a location in source code, as a range starting at a line and column and ending at some other line and column of some file. More...
 
struct  ParserStackTrace
 
class  ScopeContainer
 
class  ScopeContainerGuard
 
struct  source_location
 
struct  SourceFile
 A source file with its associated Syntax Tree. More...
 
struct  StringLiteral
 
struct  Struct
 A struct declaration in the compiler. More...
 
struct  Substitutions
 
struct  Token
 A categorized token in source code, created by the tokenizer. These tokens are consumed by the lexer. More...
 
class  Tokenizer
 Contains the state while the tokenizer is running, such as the position within the file currently being read. More...
 
struct  TokenState
 
struct  TypeHolder
 
struct  Val
 A value of a complied expression. More...
 
struct  visitable_variant
 
class  Visitor
 
struct  VTableEntry
 

Concepts

concept  OnlyStmt
 
concept  char_fn
 
concept  visitable
 

Typedefs

using Def_t = visitable_variant< ast::FnDecl *, ast::CtorDecl *, ast::LambdaExpr * >
 
using DeclLike_t = visitable_variant< std::monostate, Fn *, Struct *, Const * >
 
using char_raw_fn = bool(char)
 
template<typename T >
using nullable = T
 
template<typename T >
using nonnull = T
 

Enumerations

enum struct  Qualifier {
  Ptr , Mut , Ref , Type ,
  Opaque
}
 

Functions

auto make_atom (std::string_view value) noexcept -> Atom
 Create an Atom with the given string content. More...
 
auto operator""_a (const char *value, std::size_t len) noexcept -> Atom
 
static auto make_cdtor_fn (llvm::IRBuilder<> &builder, llvm::Module &module, bool is_ctor) -> llvm::Function *
 
static auto vtable_entry_for (const Fn &fn) -> VTableEntry
 
static void create_vtable_for (Struct &st)
 
static auto build_function_type (Compiler &compiler, const ty::Function &type) -> llvm::Type *
 
static auto build_struct_type (Compiler &compiler, const ty::Struct &type) -> llvm::Type *
 
static void destruct_indirect (Compiler &compiler, const InScope &v)
 
static auto constexpr const_hash (const char *input) -> unsigned
 A constexpr-friendly simple string hash, for simple switches with string cases. More...
 
static auto vals_to_llvm (const vector< Val > &in) -> vector< llvm::Value * >
 
void backtrace (void *)
 
auto what (const std::exception_ptr &eptr=std::current_exception()) -> std::string_view
 
auto current_exception_name () -> const char *
 
void print_exception ()
 
auto at (const source_location location=source_location::current()) -> std::string
 
auto tokenize_preserve_skipped (std::istream &in, const string &source_file) -> vector< Token >
 Consume the contents of the input stream and create corresponding tokens, preserving every token, including whitespace. This is usually undesired. More...
 
auto tokenize (std::istream &in, const string &source_file) -> vector< Token >
 Consume the contents of the input stream and create corresponding tokens, ignoring insignificant whitespace. More...
 
auto operator<< (llvm::raw_ostream &os, const Token &token) -> llvm::raw_ostream &
 
void yume_assert_failure (const std::string_view log_msg={}, const source_location location=source_location::current()) noexcept
 
auto open_file (nonnull< const char * > filename) -> unique_ptr< llvm::raw_pwrite_stream >
 Opens a writeable stream to a file with the given filename relative to the current working directory. More...
 
template<typename T >
static void hash_combine (uint64_t &seed, const T &v)
 

Variables

static constexpr const auto always_false = [](auto&&... ) { return false; }
 
template<StringLiteral msg, typename RetT = void>
static constexpr const auto always_throw
 
template<auto pm, typename R = void>
static constexpr const auto fwd = [](auto&&... args) -> R { return std::invoke(pm, args...); }
 
template<auto pm>
static constexpr const auto fwd< pm, void > = [](auto&&... args) -> decltype(auto) { return std::invoke(pm, args...); }
 
static constexpr std::string_view VERSION = "???"
 
static constexpr std::string_view GIT_SHORTHASH = "???"
 

Typedef Documentation

◆ char_raw_fn

using yume::char_raw_fn = typedef bool(char)

Definition at line 19 of file token.cpp.

◆ DeclLike_t

using yume::DeclLike_t = typedef visitable_variant<std::monostate, Fn*, Struct*, Const*>

Definition at line 204 of file vals.hpp.

◆ Def_t

Definition at line 40 of file vals.hpp.

◆ nonnull

template<typename T >
using yume::nonnull = typedef T

Definition at line 73 of file util.hpp.

◆ nullable

template<typename T >
using yume::nullable = typedef T

Definition at line 72 of file util.hpp.

Enumeration Type Documentation

◆ Qualifier

enum struct yume::Qualifier
strong
Enumerator
Ptr 

ptr

Mut 

mut

Ref 

ref

Type 

type

Opaque 

Opaque self types.

Definition at line 4 of file qualifier.hpp.

Function Documentation

◆ at()

auto yume::at ( const source_location  location = source_location::current()) -> std::string
inline

◆ backtrace()

void yume::backtrace ( void *  )

Definition at line 284 of file errors.cpp.

Referenced by main().

◆ build_function_type()

static auto yume::build_function_type ( Compiler compiler,
const ty::Function type 
) -> llvm::Type*
static

Definition at line 370 of file compiler.cpp.

Referenced by yume::Compiler::llvm_type().

◆ build_struct_type()

static auto yume::build_struct_type ( Compiler compiler,
const ty::Struct type 
) -> llvm::Type*
static

Definition at line 411 of file compiler.cpp.

Referenced by yume::Compiler::llvm_type().

◆ const_hash()

static auto constexpr yume::const_hash ( const char *  input) -> unsigned
staticconstexpr

A constexpr-friendly simple string hash, for simple switches with string cases.

Definition at line 983 of file compiler.cpp.

References const_hash().

Referenced by const_hash().

◆ create_vtable_for()

static void yume::create_vtable_for ( Struct st)
inlinestatic

◆ current_exception_name()

auto yume::current_exception_name ( ) -> const char*
inline

Definition at line 35 of file errors.hpp.

Referenced by print_exception().

◆ destruct_indirect()

static void yume::destruct_indirect ( Compiler compiler,
const InScope v 
)
static

◆ hash_combine()

template<typename T >
static void yume::hash_combine ( uint64_t &  seed,
const T &  v 
)
static

Definition at line 112 of file util.hpp.

Referenced by yume::diagnostic::HashVisitor::visit().

◆ make_atom()

auto yume::make_atom ( std::string_view  value) -> Atom
inlinenoexcept

Create an Atom with the given string content.

See also
atom_literal::operator""_a

Definition at line 34 of file atom.hpp.

References yume::Atom::make_atom().

Referenced by operator""_a(), and yume::ast::parser::Parser::try_parse_type().

◆ make_cdtor_fn()

static auto yume::make_cdtor_fn ( llvm::IRBuilder<> &  builder,
llvm::Module &  module,
bool  is_ctor 
) -> llvm::Function*
static

Definition at line 62 of file compiler.cpp.

Referenced by yume::Compiler::Compiler().

◆ open_file()

auto yume::open_file ( nonnull< const char * >  filename) -> unique_ptr<llvm::raw_pwrite_stream>
inline

Opens a writeable stream to a file with the given filename relative to the current working directory.

Definition at line 91 of file util.hpp.

Referenced by compile(), and yume::Compiler::write_object().

◆ operator""_a()

auto yume::operator""_a ( const char *  value,
std::size_t  len 
) -> Atom
inlinenoexcept

Definition at line 36 of file atom.hpp.

References make_atom().

◆ operator<<()

auto yume::operator<< ( llvm::raw_ostream &  os,
const Token token 
) -> llvm::raw_ostream&

Definition at line 291 of file token.cpp.

◆ print_exception()

void yume::print_exception ( )
inline

Definition at line 41 of file errors.hpp.

References current_exception_name(), and what().

Referenced by main().

◆ tokenize()

auto yume::tokenize ( std::istream &  in,
const string &  source_file 
) -> vector< Token >

Consume the contents of the input stream and create corresponding tokens, ignoring insignificant whitespace.

Definition at line 282 of file token.cpp.

References tokenize_preserve_skipped().

◆ tokenize_preserve_skipped()

auto yume::tokenize_preserve_skipped ( std::istream &  in,
const string &  source_file 
) -> vector< Token >

Consume the contents of the input stream and create corresponding tokens, preserving every token, including whitespace. This is usually undesired.

See also
tokenize

Definition at line 276 of file token.cpp.

Referenced by tokenize().

◆ vals_to_llvm()

static auto yume::vals_to_llvm ( const vector< Val > &  in) -> vector<llvm::Value*>
inlinestatic

Definition at line 1013 of file compiler.cpp.

Referenced by yume::Compiler::expression().

◆ vtable_entry_for()

static auto yume::vtable_entry_for ( const Fn fn) -> VTableEntry
inlinestatic

◆ what()

auto yume::what ( const std::exception_ptr &  eptr = std::current_exception()) -> std::string_view
inline

Definition at line 17 of file errors.hpp.

Referenced by print_exception().

◆ yume_assert_failure()

void yume::yume_assert_failure ( const std::string_view  log_msg = {},
const source_location  location = source_location::current() 
)
inlinenoexcept

Definition at line 84 of file util.hpp.

Variable Documentation

◆ always_false

constexpr const auto yume::always_false = [](auto&&... ) { return false; }
staticconstexpr

◆ always_throw

template<StringLiteral msg, typename RetT = void>
constexpr const auto yume::always_throw
staticconstexpr
Initial value:
=
[](auto&&... ) -> RetT { throw std::runtime_error{static_cast<const char*>(msg.value)}; }

Definition at line 12 of file vals.cpp.

Referenced by yume::Fn::fn_body(), and yume::Fn::make_extern_linkage().

◆ fwd

template<auto pm, typename R = void>
constexpr const auto yume::fwd = [](auto&&... args) -> R { return std::invoke(pm, args...); }
staticconstexpr

Definition at line 16 of file vals.cpp.

◆ fwd< pm, void >

template<auto pm>
constexpr const auto yume::fwd< pm, void > = [](auto&&... args) -> decltype(auto) { return std::invoke(pm, args...); }
staticconstexpr

Definition at line 18 of file vals.cpp.

◆ GIT_SHORTHASH

constexpr std::string_view yume::GIT_SHORTHASH = "???"
staticconstexpr

Definition at line 34 of file yumec.cpp.

Referenced by emit_version().

◆ VERSION

constexpr std::string_view yume::VERSION = "???"
staticconstexpr

Definition at line 33 of file yumec.cpp.

Referenced by emit_version().