I'm trying to find a way to set the assembly syntax that LLVM outputs (for x86 in particular). Following the Compiling to Object Code section of the Kaleidoscope tutorial, I'm outputting assembly files with
TargetMachine->addPassesToEmitFile(pass, dest, nullptr, llvm::CGFT_AssemblyFile))
But there's no option to set the output syntax.
llc has the command line option --x86-asm-syntax with which you can set the output assembly syntax (for x86), so I'm sure there must be a way to do it.
So is there a way this can be done through LLVM's C++ API?
TargetMachine, the Opt is made ofTargetOptions, which apparently includes things like AssemblyLanguage. That's where I'd start, anyway.AssemblyLanguage(or similar) in the llvm include directory also returns nothing.AssemblyLanguageis only referenced here where it only checks if it's equal to"masm", so this may not be what I'm looking for after all.