[Mesa-dev] [PATCH] gallivm: Pass in a MCRegisterInfo to MCInstPrinter on llvm-3.1.
Brian Paul
brianp at vmware.com
Tue Mar 6 09:22:42 PST 2012
On 03/05/2012 11:08 PM, Vinson Lee wrote:
> llvm-3.1svn r152043 changes createMCInstPrinter to take an additional
> MCRegisterInfo argument.
>
> Signed-off-by: Vinson Lee<vlee at freedesktop.org>
> ---
> src/gallium/auxiliary/gallivm/lp_bld_debug.cpp | 13 ++++++++++++-
> 1 files changed, 12 insertions(+), 1 deletions(-)
>
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
> index 11209da..b6849cb 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_debug.cpp
> @@ -243,7 +243,18 @@ lp_disassemble(const void* func)
> int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
> #endif
>
> -#if HAVE_LLVM>= 0x0300
> +#if HAVE_LLVM>= 0x0301
> + OwningPtr<const MCRegisterInfo> MRI(T->createMCRegInfo(Triple));
> + if (!MRI) {
> + debug_printf("error: no register info for target %s\n", Triple.c_str());
> + return;
> + }
> +#endif
> +
> +#if HAVE_LLVM>= 0x0301
> + OwningPtr<MCInstPrinter> Printer(
> + T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MRI, *STI));
> +#elif HAVE_LLVM == 0x0300
> OwningPtr<MCInstPrinter> Printer(
> T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *STI));
> #elif HAVE_LLVM>= 0x0208
Looks OK to me. Reviewed-by: Brian Paul <brianp at vmware.com>
More information about the mesa-dev
mailing list