aboutsummaryrefslogtreecommitdiff
path: root/clang/tools
diff options
context:
space:
mode:
Diffstat (limited to 'clang/tools')
-rw-r--r--clang/tools/cir-lsp-server/CMakeLists.txt15
-rw-r--r--clang/tools/cir-opt/cir-opt.cpp3
-rw-r--r--clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp14
3 files changed, 18 insertions, 14 deletions
diff --git a/clang/tools/cir-lsp-server/CMakeLists.txt b/clang/tools/cir-lsp-server/CMakeLists.txt
index aad2646..f421215 100644
--- a/clang/tools/cir-lsp-server/CMakeLists.txt
+++ b/clang/tools/cir-lsp-server/CMakeLists.txt
@@ -1,26 +1,23 @@
-get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
-get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
-
include_directories(${LLVM_MAIN_SRC_DIR}/../mlir/include)
include_directories(${CMAKE_BINARY_DIR}/tools/mlir/include)
set(LIBS
- ${dialect_libs}
- ${conversion_libs}
${test_libs}
clangCIR
clangCIRLoweringDirectToLLVM
- MLIRCIR
MLIRAffineAnalysis
MLIRAnalysis
+ MLIRCIR
MLIRDialect
+ MLIRIR
MLIRLspServerLib
MLIRParser
MLIRPass
- MLIRTransforms
- MLIRTransformUtils
+ MLIRRegisterAllDialects
+ MLIRRegisterAllPasses
MLIRSupport
- MLIRIR
+ MLIRTransformUtils
+ MLIRTransforms
)
add_mlir_tool(cir-lsp-server
diff --git a/clang/tools/cir-opt/cir-opt.cpp b/clang/tools/cir-opt/cir-opt.cpp
index 3dad3b1..c4d29a2 100644
--- a/clang/tools/cir-opt/cir-opt.cpp
+++ b/clang/tools/cir-opt/cir-opt.cpp
@@ -17,11 +17,12 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
-#include "mlir/InitAllPasses.h"
+#include "mlir/IR/BuiltinDialect.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Pass/PassOptions.h"
#include "mlir/Pass/PassRegistry.h"
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
+#include "mlir/Transforms/Passes.h"
#include "clang/CIR/Dialect/IR/CIRDialect.h"
#include "clang/CIR/Dialect/Passes.h"
#include "clang/CIR/Passes.h"
diff --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 9d34b62..1d91f5f2 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -474,10 +474,10 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles, const ArgList &Args,
StringRef Arch = Args.getLastArgValue(OPT_arch_EQ);
// Create a new file to write the linked device image to. Assume that the
// input filename already has the device and architecture.
- auto TempFileOrErr =
- createOutputFile(sys::path::filename(ExecutableName) + "." +
- Triple.getArchName() + "." + Arch,
- "img");
+ std::string OutputFileBase =
+ "." + Triple.getArchName().str() + "." + Arch.str();
+ auto TempFileOrErr = createOutputFile(
+ sys::path::filename(ExecutableName) + OutputFileBase, "img");
if (!TempFileOrErr)
return TempFileOrErr.takeError();
@@ -486,6 +486,12 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles, const ArgList &Args,
"--no-default-config",
"-o",
*TempFileOrErr,
+ // Without -dumpdir, Clang will place auxiliary output files in the
+ // temporary directory of TempFileOrErr, where they will not easily be
+ // found by the user and might eventually be automatically removed. Tell
+ // Clang to instead place them alongside the final executable.
+ "-dumpdir",
+ Args.MakeArgString(ExecutableName + OutputFileBase + ".img."),
Args.MakeArgString("--target=" + Triple.getTriple()),
};