From ea97153b1b00a1ae3d974c8c6abb429882b1a96d Mon Sep 17 00:00:00 2001 From: George Stelle Date: Thu, 29 Aug 2024 10:21:26 -0600 Subject: [PATCH] dev/18.x linking error fixes (#49) clang/lib/Frontend has a call to a Tapir << operator, which means it has to be linked against TapirOpts. There's unguarded checks to Value::dump in HipABI, which is disabled for release builds, so I've replaced them with LLVM_DEBUG calls. Note this means you don't have that output before assertion failure for release builds. Other options if that's important. --- clang/lib/Frontend/CMakeLists.txt | 1 + llvm/lib/Transforms/Tapir/CMakeLists.txt | 1 + llvm/lib/Transforms/Tapir/HipABI.cpp | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/clang/lib/Frontend/CMakeLists.txt b/clang/lib/Frontend/CMakeLists.txt index a91666720884591..871dc50b7be43a8 100644 --- a/clang/lib/Frontend/CMakeLists.txt +++ b/clang/lib/Frontend/CMakeLists.txt @@ -7,6 +7,7 @@ set(LLVM_LINK_COMPONENTS ProfileData Support TargetParser + TapirOpts ) add_clang_library(clangFrontend diff --git a/llvm/lib/Transforms/Tapir/CMakeLists.txt b/llvm/lib/Transforms/Tapir/CMakeLists.txt index 3af5a9d16bcad31..2979f8d0d6f5e3b 100644 --- a/llvm/lib/Transforms/Tapir/CMakeLists.txt +++ b/llvm/lib/Transforms/Tapir/CMakeLists.txt @@ -45,6 +45,7 @@ add_llvm_component_library(LLVMTapirOpts Support TransformUtils Vectorize + Passes ) if (CUDAToolkit_FOUND) diff --git a/llvm/lib/Transforms/Tapir/HipABI.cpp b/llvm/lib/Transforms/Tapir/HipABI.cpp index 0b02db079d9d9c1..549f1f958e98721 100644 --- a/llvm/lib/Transforms/Tapir/HipABI.cpp +++ b/llvm/lib/Transforms/Tapir/HipABI.cpp @@ -637,8 +637,8 @@ void HipABI::transformConstants(Function *Fn) { GEP->setOperand(GEP->getPointerOperandIndex(), asCast); LLVM_DEBUG(dbgs() << "\t\t\t\tnew gep:\n\t\t\t\t " << *GEP << "\n"); } else { - U->get()->dump(); - U->getUser()->dump(); + LLVM_DEBUG(dbgs() << U->get()); + LLVM_DEBUG(dbgs() << U->getUser()); assert(false && "unexpected use/user of gep."); } }