From 8d9778589f4b3a174e884338adb0fe1bdeca5eb7 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 10 May 2012 10:21:54 -0400 Subject: radeon: Support LLVM 3.2 LLVM 3.2 and newer requires that the R600/SI backend be part of the LLVM tree. --- src/gallium/drivers/radeon/Makefile | 6 ++++++ src/gallium/drivers/radeon/Makefile.sources | 7 ++++--- src/gallium/drivers/radeon/radeon_llvm_emit.cpp | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gallium/drivers/radeon/Makefile b/src/gallium/drivers/radeon/Makefile index 7f1c61352e3..bcc2646dd5f 100644 --- a/src/gallium/drivers/radeon/Makefile +++ b/src/gallium/drivers/radeon/Makefile @@ -12,6 +12,12 @@ TBLGEN = $(LLVM_BINDIR)/llvm-tblgen CXXFLAGS+= $(LLVM_CXXFLAGS) +ifeq ($(LLVM_VERSION),3.1) + CPP_SOURCES += $(LLVM_CPP_SOURCES) +else + CXXFLAGS+= -DEXTERNAL_LLVM +endif + include ../../Makefile.template CXXFLAGS := $(filter-out -DDEBUG, $(CXXFLAGS)) diff --git a/src/gallium/drivers/radeon/Makefile.sources b/src/gallium/drivers/radeon/Makefile.sources index c5d1207451a..5e793422d66 100644 --- a/src/gallium/drivers/radeon/Makefile.sources +++ b/src/gallium/drivers/radeon/Makefile.sources @@ -23,8 +23,7 @@ TD_FILES := \ SIRegisterInfo.td \ SISchedule.td - -GENERATED_SOURCES := \ +LLVM_GENERATED_SOURCES := \ R600Intrinsics.td \ R600RegisterInfo.td \ SIRegisterInfo.td \ @@ -41,7 +40,7 @@ GENERATED_SOURCES := \ AMDGPUGenMCCodeEmitter.inc \ AMDGPUGenDFAPacketizer.inc -CPP_SOURCES := \ +LLVM_CPP_SOURCES := \ AMDIL7XXDevice.cpp \ AMDILCFGStructurizer.cpp \ AMDILDevice.cpp \ @@ -81,6 +80,8 @@ CPP_SOURCES := \ MCTargetDesc/SIMCCodeEmitter.cpp \ MCTargetDesc/R600MCCodeEmitter.cpp \ TargetInfo/AMDGPUTargetInfo.cpp \ + +CPP_SOURCES := \ radeon_llvm_emit.cpp C_SOURCES := \ diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp index 1b67bfea685..625b0b491d6 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.cpp +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.cpp @@ -90,6 +90,7 @@ radeon_llvm_compile(LLVMModuleRef M, unsigned char ** bytes, /* XXX: Can we just initialize the AMDGPU target here? */ InitializeAllTargets(); InitializeAllTargetMCs(); + InitializeAllAsmPrinters(); #else LLVMInitializeAMDGPUTargetInfo(); LLVMInitializeAMDGPUTarget(); -- cgit v1.2.3