8 #ifndef LOADSYMBOLRESOLVERBASE_H_
9 #define LOADSYMBOLRESOLVERBASE_H_
12 #include "LLVMIncludes.h"
13 #include "LLVMModelDataSymbols.h"
14 #include "LLVMModelSymbols.h"
15 #include "ModelGeneratorContext.h"
17 #include <rr_unordered_map>
42 void recursiveSymbolPush(
const std::string& symbol)
override;
44 void recursiveSymbolPop()
override;
46 virtual bool isLocalParameter(
const std::string& symbol)
override;
73 typedef std::list<std::string> StringStack;
74 typedef std::unordered_map<std::string, llvm::Value*> ValueMap;
75 typedef std::deque<ValueMap> ValueMapStack;
78 const libsbml::Model *model;
81 llvm::IRBuilder<> &builder;
82 llvm::Value *modelData;
85 StringStack symbolStack;
88 ValueMapStack symbolCache;
97 llvm::Value*
cacheValue(
const std::string& symbol,
98 const llvm::ArrayRef<llvm::Value*>& args,
99 llvm::Value* value =
nullptr);
stores the names of all the symbols in the sbml model and thier indexes in the ModelData arrays.
Definition: LLVMModelDataSymbols.h:128
Hold all the un-evaluated symbolic inforamtion in the model.
Definition: LLVMModelSymbols.h:26
provide common sbml model functionality to three kinds of resolvers.
Definition: LoadSymbolResolverBase.h:34
llvm::Value * cacheValue(const std::string &symbol, const llvm::ArrayRef< llvm::Value * > &args, llvm::Value *value=nullptr)
check in the symbol cache if the symbol exists, if so return it.
Definition: LoadSymbolResolverBase.cpp:111
size_t pushCacheBlock() override
nested conditionals (or functions?) can push a local cache block, where symbols would be chached.
Definition: LoadSymbolResolverBase.cpp:96
void flushCache()
Flush the symbol cache.
Definition: LoadSymbolResolverBase.cpp:90
llvm::Value * loadReactionRate(const libsbml::Reaction *)
shortcut to get a reaction rate, performance wise, quicker than going through all the loadSymbolValue...
Definition: LoadSymbolResolverBase.cpp:39
size_t popCacheBlock() override
Pop a scoped cache block, this clears these values, and any subsequent reads re-evaluate the requeste...
Definition: LoadSymbolResolverBase.cpp:102
LLVM load instruction class.
Definition: CodeGen.h:37
All LLVM code generating objects basically need at a minimum three things to operate:
Definition: ModelGeneratorContext.h:95