[llvm] r183871 - Print ConstantPool entries initialized to Values with WriteAsOperand instead of
Dan Gohman
dan433584 at gmail.com
Wed Jun 12 15:19:19 PDT 2013
Author: djg
Date: Wed Jun 12 17:19:19 2013
New Revision: 183871
URL: http://llvm.org/viewvc/llvm-project?rev=183871&view=rev
Log:
Print ConstantPool entries initialized to Values with WriteAsOperand instead of
operator<< so that functions are printed as just their name instead of as their
entire definition, which is excessively verbose in this context.
Modified:
llvm/trunk/lib/CodeGen/MachineFunction.cpp
Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=183871&r1=183870&r2=183871&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Wed Jun 12 17:19:19 2013
@@ -17,6 +17,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Analysis/ConstantFolding.h"
+#include "llvm/Assembly/Writer.h"
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
@@ -887,7 +888,7 @@ void MachineConstantPool::print(raw_ostr
if (Constants[i].isMachineConstantPoolEntry())
Constants[i].Val.MachineCPVal->print(OS);
else
- OS << *(const Value*)Constants[i].Val.ConstVal;
+ WriteAsOperand(OS, Constants[i].Val.ConstVal, /*PrintType=*/false);
OS << ", align=" << Constants[i].getAlignment();
OS << "\n";
}
More information about the llvm-commits
mailing list