diff options
author | Igor Laevsky <igmyrj@gmail.com> | 2015-05-05 13:20:42 +0000 |
---|---|---|
committer | Igor Laevsky <igmyrj@gmail.com> | 2015-05-05 13:20:42 +0000 |
commit | 2aa8cafaf67e31af5eea1b073c109f83d87f7bf5 (patch) | |
tree | d62681449bb2bda6decde228ffc12adf4ac4008c /llvm/lib/IR/AsmWriter.cpp | |
parent | c23ba555c2cbd73548a6362cc4944d4867311400 (diff) | |
download | bcm5719-llvm-2aa8cafaf67e31af5eea1b073c109f83d87f7bf5.tar.gz bcm5719-llvm-2aa8cafaf67e31af5eea1b073c109f83d87f7bf5.zip |
Emit comment for gc.relocate showing base and derived pointers in human readable form.
Differential Revision: http://reviews.llvm.org/D9326
llvm-svn: 236497
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 6dfb7fa6b0f..6b575212301 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -31,6 +31,7 @@ #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/Operator.h" +#include "llvm/IR/Statepoint.h" #include "llvm/IR/TypeFinder.h" #include "llvm/IR/UseListOrder.h" #include "llvm/IR/ValueSymbolTable.h" @@ -2002,6 +2003,10 @@ private: // printInfoComment - Print a little comment after the instruction indicating // which slot it occupies. void printInfoComment(const Value &V); + + // printGCRelocateComment - print comment after call to the gc.relocate + // intrinsic indicating base and derived pointer names. + void printGCRelocateComment(const Value &V); }; } // namespace @@ -2642,10 +2647,26 @@ void AssemblyWriter::printInstructionLine(const Instruction &I) { Out << '\n'; } +/// printGCRelocateComment - print comment after call to the gc.relocate +/// intrinsic indicating base and derived pointer names. +void AssemblyWriter::printGCRelocateComment(const Value &V) { + assert(isGCRelocate(&V)); + GCRelocateOperands GCOps(cast<Instruction>(&V)); + + Out << " ; ("; + writeOperand(GCOps.basePtr(), false); + Out << ", "; + writeOperand(GCOps.derivedPtr(), false); + Out << ")"; +} + /// printInfoComment - Print a little comment after the instruction indicating /// which slot it occupies. /// void AssemblyWriter::printInfoComment(const Value &V) { + if (isGCRelocate(&V)) + printGCRelocateComment(V); + if (AnnotationWriter) AnnotationWriter->printInfoComment(V, Out); } |