From 670655471dfc35d90271393bd3e6e26a708f1a3c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 16 Oct 2013 16:21:40 +0000 Subject: Assert on duplicate registration. Don't depend on function pointer equality. Before this patch we would assert when building llvm as multiple shared libraries (cmake's BUILD_SHARED_LIBS). The problem was the line if (T.AsmStreamerCtorFn == Target::createDefaultAsmStreamer) which returns false because of -fvisibility-inlines-hidden. It is easy to fix just this one case, but I decided to try to also make the registration more strict. It looks like the old logic for ignoring followup registration was just a temporary hack that outlived its usefulness. This patch converts the ifs to asserts, fixes the few cases that were registering twice and makes sure all the asserts compare with null. Thanks for Joerg for reporting the problem and reviewing the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192803 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/NVPTX/NVPTXTargetMachine.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'lib/Target') diff --git a/lib/Target/NVPTX/NVPTXTargetMachine.cpp b/lib/Target/NVPTX/NVPTXTargetMachine.cpp index c319655..ed5634a 100644 --- a/lib/Target/NVPTX/NVPTXTargetMachine.cpp +++ b/lib/Target/NVPTX/NVPTXTargetMachine.cpp @@ -57,9 +57,6 @@ extern "C" void LLVMInitializeNVPTXTarget() { RegisterTargetMachine X(TheNVPTXTarget32); RegisterTargetMachine Y(TheNVPTXTarget64); - RegisterMCAsmInfo A(TheNVPTXTarget32); - RegisterMCAsmInfo B(TheNVPTXTarget64); - // FIXME: This pass is really intended to be invoked during IR optimization, // but it's very NVPTX-specific. initializeNVVMReflectPass(*PassRegistry::getPassRegistry()); -- cgit v1.1