mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 00:17:01 +00:00
uselistorder: Pull the assembly bit up out of the printer
Pull the `-preserve-ll-uselistorder` bit up through all the callers of `Module::print()`. I converted callers of `operator<<` to `Module::print()` where necessary to pull the bit through. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234968 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3071,11 +3071,11 @@ void Function::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
|
||||
W.printFunction(this);
|
||||
}
|
||||
|
||||
void Module::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW) const {
|
||||
void Module::print(raw_ostream &ROS, AssemblyAnnotationWriter *AAW,
|
||||
bool ShouldPreserveUseListOrder) const {
|
||||
SlotTracker SlotTable(this);
|
||||
formatted_raw_ostream OS(ROS);
|
||||
AssemblyWriter W(OS, SlotTable, this, AAW,
|
||||
shouldPreserveAssemblyUseListOrder());
|
||||
AssemblyWriter W(OS, SlotTable, this, AAW, ShouldPreserveUseListOrder);
|
||||
W.printModule(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "llvm/IR/Function.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/IR/PassManager.h"
|
||||
#include "llvm/IR/UseListOrder.h"
|
||||
#include "llvm/Pass.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
@@ -25,7 +26,8 @@ PrintModulePass::PrintModulePass(raw_ostream &OS, const std::string &Banner)
|
||||
: OS(OS), Banner(Banner) {}
|
||||
|
||||
PreservedAnalyses PrintModulePass::run(Module &M) {
|
||||
OS << Banner << M;
|
||||
OS << Banner;
|
||||
M.print(OS, nullptr, shouldPreserveAssemblyUseListOrder());
|
||||
return PreservedAnalyses::all();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user