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

Method FinalizeLazyMaterialization

be/src/codegen/llvm-codegen.cc:1147–1168  ·  view source on GitHub ↗

It's okay to call this function even if the module has been materialized.

Source from the content-addressed store, hash-verified

1145
1146// It's okay to call this function even if the module has been materialized.
1147Status LlvmCodeGen::FinalizeLazyMaterialization() {
1148 for (llvm::Function& fn : module_->functions()) {
1149 if (fn.isMaterializable()) {
1150 DCHECK(!module_->isMaterialized());
1151 // Unmaterialized functions can still have their declarations around. LLVM asserts
1152 // these unmaterialized functions' linkage types are external / external weak.
1153 fn.setLinkage(llvm::Function::ExternalLinkage);
1154 // DCE may claim the personality function is still referenced by unmaterialized
1155 // functions when it is deleted by DCE. Similarly, LLVM may complain if comdats
1156 // reference unmaterialized functions but their definition cannot be found.
1157 // Since the unmaterialized functions are not used anyway, just remove their
1158 // personality functions and comdats.
1159 fn.setPersonalityFn(NULL);
1160 fn.setComdat(NULL);
1161 fn.setIsMaterializable(false);
1162 }
1163 }
1164 // All unused functions are now not materializable so it should be quick to call
1165 // materializeAll(). We need to call this function in order to destroy the
1166 // materializer so that DCE will not assert fail.
1167 return MaterializeModule();
1168}
1169
1170bool LlvmCodeGen::LookupCache(CodeGenCacheKey& cache_key) {
1171 DCHECK(!cache_key.empty());

Callers 2

CheckResultMethod · 0.80
CreateObjCacheMethod · 0.80

Calls 1

isMaterializedMethod · 0.45

Tested by 2

CheckResultMethod · 0.64
CreateObjCacheMethod · 0.64