| chigraph master Systems programming language written for beginners in LLVM

ChiModule.cpp
Go to the documentation of this file.
1
3 #include "chi/ChiModule.hpp"
4 #include "chi/Context.hpp"
5 #include "chi/Support/Result.hpp"
6
7 namespace chi {
8 ChiModule::ChiModule(Context& contextArg, boost::filesystem::path moduleFullName)
9 : mFullName{std::move(moduleFullName)}, mContext{&contextArg} {
10 mName = mFullName.filename().string();
11 }
12
13 Result ChiModule::addDependency(boost::filesystem::path newDepFullPath) {
14 Result res = context().loadModule(newDepFullPath);
15
16 if (res) { mDependencies.emplace(std::move(newDepFullPath)); }
17
18 return res;
19 }
20 } // namespace chi
Result.hpp
Defines the Result class and related functions.
chi::Context::loadModule
Result loadModule(const boost::filesystem::path &name, ChiModule **toFill=nullptr)
Load a module from disk, also loads dependencies.
Definition: Context.cpp:91
chi::ChiModule::addDependency
Result addDependency(boost::filesystem::path newDepFullPath)
Add a dependency to the module Loads the module from context() if it isn&#39;t already loaded...
Definition: ChiModule.cpp:13
chi::ChiModule::ChiModule
ChiModule(Context &contextArg, boost::filesystem::path moduleFullName)
Default constructor.
Definition: ChiModule.cpp:8
chi::Context
The class that handles the loading, creation, storing, and compilation of modules It also stores a LL...
Definition: Context.hpp:55
ChiModule.hpp
Defines the ChiModule class.
chi
The namespace where chigraph lives.
Definition: BitcodeParser.hpp:12
chi::ChiModule::context
Context & context() const
Get the Context that this module belongs to.
Definition: ChiModule.hpp:68
Context.hpp
Defines the Context class and related functions.
chi::Result
The result object, used for identifiying errors with good diagnostics.
Definition: Result.hpp:72