1
Fork 0

Make LLVM emit assembly comments with -Z asm-comments.

Fixes #35741.
This commit is contained in:
whitequark 2018-08-12 17:59:18 +00:00
parent 0aa8d03202
commit 66fd1ebfae
3 changed files with 9 additions and 2 deletions

View file

@ -366,7 +366,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
bool PositionIndependentExecutable, bool FunctionSections,
bool DataSections,
bool TrapUnreachable,
bool Singlethread) {
bool Singlethread,
bool AsmComments) {
auto OptLevel = fromRust(RustOptLevel);
auto RM = fromRust(RustReloc);
@ -393,6 +394,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
}
Options.DataSections = DataSections;
Options.FunctionSections = FunctionSections;
Options.MCOptions.AsmVerbose = AsmComments;
Options.MCOptions.PreserveAsmComments = AsmComments;
if (TrapUnreachable) {
// Tell LLVM to codegen `unreachable` into an explicit trap instruction.