summaryrefslogtreecommitdiff
path: root/Context.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Context.cc')
-rw-r--r--Context.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/Context.cc b/Context.cc
index 2462b64..b7b5100 100644
--- a/Context.cc
+++ b/Context.cc
@@ -29,17 +29,16 @@ void Context::PushScope(VariableList* scope) { scopes_.push(scope); }
void Context::PopScope() { scopes_.pop(); }
-std::shared_ptr<FunctionType> Context::GetFunctionType(std::string name) {
- decltype(FuncTypes_)::iterator result = FuncTypes_.find(name);
- if (result == FuncTypes_.end()) {
- return nullptr;
+Function Context::FindFunction(std::string name) {
+ decltype(Functions_)::iterator result = Functions_.find(name);
+ if (result == Functions_.end()) {
+ return {nullptr, nullptr};
}
return std::get<1>(*result);
}
-void Context::AddFunctionType(std::string name,
- std::shared_ptr<FunctionType> type) {
- FuncTypes_.insert({name, type});
+void Context ::AddFunction(std::string name, Function func) {
+ Functions_.emplace(name, func);
}
void Context::PushBreakDestination(llvm::BasicBlock* dest) {