| 1621 | } |
| 1622 | |
| 1623 | Status LlvmCodeGen::GetSymbols(const string& file, const string& module_id, |
| 1624 | unordered_set<string>* symbols) { |
| 1625 | ObjectPool pool; |
| 1626 | scoped_ptr<LlvmCodeGen> codegen; |
| 1627 | RETURN_IF_ERROR(CreateFromFile(nullptr, &pool, nullptr, file, module_id, &codegen)); |
| 1628 | for (const llvm::Function& fn : codegen->module_->functions()) { |
| 1629 | if (fn.isMaterializable()) symbols->insert(fn.getName()); |
| 1630 | } |
| 1631 | codegen->Close(); |
| 1632 | return Status::OK(); |
| 1633 | } |
| 1634 | |
| 1635 | // TODO: cache this function (e.g. all min(int, int) are identical). |
| 1636 | // we probably want some more global IR function cache, or, implement this |