MCPcopy Create free account
hub / github.com/apache/arrow / MakeTargetMachineBuilder

Function MakeTargetMachineBuilder

cpp/src/gandiva/engine.cc:142–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142Result<llvm::orc::JITTargetMachineBuilder> MakeTargetMachineBuilder(
143 const Configuration& conf) {
144 llvm::orc::JITTargetMachineBuilder jtmb(
145 (llvm::Triple(llvm::sys::getDefaultTargetTriple())));
146 jtmb.setRelocationModel(llvm::Reloc::PIC_);
147 if (conf.target_host_cpu()) {
148 jtmb.setCPU(cpu_name.str());
149 jtmb.addFeatures(cpu_attrs);
150 }
151#if LLVM_VERSION_MAJOR >= 18
152 using CodeGenOptLevel = llvm::CodeGenOptLevel;
153#else
154 using CodeGenOptLevel = llvm::CodeGenOpt::Level;
155#endif
156 const auto opt_level =
157 conf.optimize() ? CodeGenOptLevel::Aggressive : CodeGenOptLevel::None;
158 jtmb.setCodeGenOptLevel(opt_level);
159 return jtmb;
160}
161
162std::string DumpModuleIR(const llvm::Module& module) {
163 std::string ir;

Callers

nothing calls this directly

Calls 1

strMethod · 0.80

Tested by

no test coverage detected