MCPcopy Create free account
hub / github.com/apache/impala / CreateObjCache

Method CreateObjCache

be/src/codegen/llvm-codegen-cache-test.cc:177–204  ·  view source on GitHub ↗

The function is to create and return a CodeGenObjectCache which contains a specific compiled codegened function.

Source from the content-addressed store, hash-verified

175// The function is to create and return a CodeGenObjectCache which contains a specific
176// compiled codegened function.
177shared_ptr<CodeGenObjectCache> LlvmCodeGenCacheTest::CreateObjCache(
178 bool is_double, string* module_id) {
179 scoped_ptr<LlvmCodeGen> codegen;
180 shared_ptr<CodeGenObjectCache> engine_cache = make_shared<CodeGenObjectCache>();
181 EXPECT_TRUE(
182 LlvmCodeGen::CreateImpalaCodegen(fragment_state_, nullptr, "test", &codegen).ok());
183 string m_id;
184 if (is_double) {
185 AddLlvmCodegenDouble(codegen.get(), nullptr, false /*doFinalizeModule*/);
186 m_id = "module_double";
187 } else {
188 AddLlvmCodegenEcho(codegen.get(), nullptr, false /*doFinalizeModule*/);
189 m_id = "module_echo";
190 }
191 EXPECT_TRUE(codegen->FinalizeLazyMaterialization().ok());
192 codegen->PruneModule();
193 EXPECT_TRUE(codegen->OptimizeModule().ok());
194 codegen->module_->setModuleIdentifier(m_id);
195 codegen->engine_cache_ = engine_cache;
196 codegen->execution_engine()->setObjectCache(engine_cache.get());
197 codegen->execution_engine()->finalizeObject();
198 CheckObjCacheExists(codegen.get());
199 codegen->DestroyModule();
200 CheckResult(codegen.get(), is_double);
201 codegen->Close();
202 if (module_id != nullptr) *module_id = m_id;
203 return engine_cache;
204}
205
206void LlvmCodeGenCacheTest::AddLlvmCodegenEcho(
207 LlvmCodeGen* codegen, string* module_id = nullptr, bool doFinalizeModule = true) {

Callers

nothing calls this directly

Calls 8

PruneModuleMethod · 0.80
OptimizeModuleMethod · 0.80
execution_engineMethod · 0.80
DestroyModuleMethod · 0.80
getMethod · 0.65
okMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected