From 73050e1c383100d879597f5d4ef8260bb1d6f07c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 28 Oct 2009 03:38:12 +0000 Subject: [PATCH] asmprinter support for BlockAddress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85367 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/AsmWriter.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 296cc25617e..2a25841b39e 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1060,6 +1060,15 @@ static void WriteConstantInt(raw_ostream &Out, const Constant *CV, Out << "zeroinitializer"; return; } + + if (const BlockAddress *BA = dyn_cast(CV)) { + Out << "blockaddress("; + WriteAsOperandInternal(Out, BA->getFunction(), &TypePrinter, Machine); + Out << ", "; + WriteAsOperandInternal(Out, BA->getBasicBlock(), &TypePrinter, Machine); + Out << ")"; + return; + } if (const ConstantArray *CA = dyn_cast(CV)) { // As a special case, print the array as a string if it is an array of -- 2.11.0