r332848 - [AMDGPU] fixes for lds f32 builtins

2018-05-21 Thread Daniil Fukalov via cfe-commits
Author: dfukalov
Date: Mon May 21 09:18:07 2018
New Revision: 332848

URL: http://llvm.org/viewvc/llvm-project?rev=332848&view=rev
Log:
[AMDGPU] fixes for lds f32 builtins

1. added restrictions to memory scope, order and volatile parameters
2. added custom processing for these builtins - currently is not used code,
   needed to switch off GCCBuiltin link to the builtins (ongoing change to llvm
   tree)
3. builtins renamed as requested

Differential Revision: https://reviews.llvm.org/D43281

Modified:
cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
cfe/trunk/test/SemaOpenCL/builtins-amdgcn-error.cl

Modified: cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def?rev=332848&r1=332847&r2=332848&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def Mon May 21 09:18:07 2018
@@ -93,9 +93,9 @@ BUILTIN(__builtin_amdgcn_ds_bpermute, "i
 BUILTIN(__builtin_amdgcn_readfirstlane, "ii", "nc")
 BUILTIN(__builtin_amdgcn_readlane, "iii", "nc")
 BUILTIN(__builtin_amdgcn_fmed3f, "", "nc")
-BUILTIN(__builtin_amdgcn_ds_fadd, "ff*3fiib", "n")
-BUILTIN(__builtin_amdgcn_ds_fmin, "ff*3fiib", "n")
-BUILTIN(__builtin_amdgcn_ds_fmax, "ff*3fiib", "n")
+BUILTIN(__builtin_amdgcn_ds_faddf, "ff*fIiIiIb", "n")
+BUILTIN(__builtin_amdgcn_ds_fminf, "ff*fIiIiIb", "n")
+BUILTIN(__builtin_amdgcn_ds_fmaxf, "ff*fIiIiIb", "n")
 
 
//===--===//
 // VI+ only builtins.

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=332848&r1=332847&r2=332848&view=diff
==
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon May 21 09:18:07 2018
@@ -10088,6 +10088,49 @@ Value *CodeGenFunction::EmitAMDGPUBuilti
 CI->setConvergent();
 return CI;
   }
+  case AMDGPU::BI__builtin_amdgcn_ds_faddf:
+  case AMDGPU::BI__builtin_amdgcn_ds_fminf:
+  case AMDGPU::BI__builtin_amdgcn_ds_fmaxf: {
+llvm::SmallVector Args;
+for (unsigned I = 0; I != 5; ++I)
+  Args.push_back(EmitScalarExpr(E->getArg(I)));
+const llvm::Type *PtrTy = Args[0]->getType();
+// check pointer parameter
+if (!PtrTy->isPointerTy() ||
+E->getArg(0)
+->getType()
+->getPointeeType()
+.getQualifiers()
+.getAddressSpace() != LangAS::opencl_local ||
+!PtrTy->getPointerElementType()->isFloatTy()) {
+   CGM.Error(E->getArg(0)->getLocStart(),
+"parameter should have type \"local float*\"");
+  return nullptr;
+}
+// check float parameter
+if (!Args[1]->getType()->isFloatTy()) {
+  CGM.Error(E->getArg(1)->getLocStart(),
+"parameter should have type \"float\"");
+  return nullptr;
+}
+
+Intrinsic::ID ID;
+switch (BuiltinID) {
+case AMDGPU::BI__builtin_amdgcn_ds_faddf:
+  ID = Intrinsic::amdgcn_ds_fadd;
+  break;
+case AMDGPU::BI__builtin_amdgcn_ds_fminf:
+  ID = Intrinsic::amdgcn_ds_fmin;
+  break;
+case AMDGPU::BI__builtin_amdgcn_ds_fmaxf:
+  ID = Intrinsic::amdgcn_ds_fmax;
+  break;
+default:
+  llvm_unreachable("Unknown BuiltinID");
+}
+Value *F = CGM.getIntrinsic(ID);
+return Builder.CreateCall(F, Args);
+  }
 
   // amdgcn workitem
   case AMDGPU::BI__builtin_amdgcn_workitem_id_x:

Modified: cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl?rev=332848&r1=332847&r2=332848&view=diff
==
--- cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl Mon May 21 09:18:07 2018
@@ -91,18 +91,18 @@ void test_mov_dpp(global int* out, int s
 
 // CHECK-LABEL: @test_ds_fadd
 // CHECK: call float @llvm.amdgcn.ds.fadd(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
-void test_ds_fadd(__attribute__((address_space(3))) float *out, float src) {
-  *out = __builtin_amdgcn_ds_fadd(out, src, 0, 0, false);
+void test_ds_faddf(local float *out, float src) {
+  *out = __builtin_amdgcn_ds_faddf(out, src, 0, 0, false);
 }
 
 // CHECK-LABEL: @test_ds_fmin
 // CHECK: call float @llvm.amdgcn.ds.fmin(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
-void test_ds_fmin(__attribute__((address_space(3))) float *out, float src) {
-  *out = __builtin_amdgcn_ds_fmin(out, src, 0, 0, false);
+void test_ds_fminf(local float *out, float src) {
+  *out = __builtin_am

r324201 - Recommit rL323890: [AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions

2018-02-06 Thread Daniil Fukalov via cfe-commits
Author: dfukalov
Date: Sun Feb  4 14:32:07 2018
New Revision: 324201

URL: http://llvm.org/viewvc/llvm-project?rev=324201&view=rev
Log:
Recommit rL323890: [AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions

Fixed asserts in tests.

Modified:
cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl

Modified: cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def?rev=324201&r1=324200&r2=324201&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def Sun Feb  4 14:32:07 2018
@@ -93,6 +93,9 @@ BUILTIN(__builtin_amdgcn_ds_bpermute, "i
 BUILTIN(__builtin_amdgcn_readfirstlane, "ii", "nc")
 BUILTIN(__builtin_amdgcn_readlane, "iii", "nc")
 BUILTIN(__builtin_amdgcn_fmed3f, "", "nc")
+BUILTIN(__builtin_amdgcn_ds_fadd, "ff*3fiib", "n")
+BUILTIN(__builtin_amdgcn_ds_fmin, "ff*3fiib", "n")
+BUILTIN(__builtin_amdgcn_ds_fmax, "ff*3fiib", "n")
 
 
//===--===//
 // VI+ only builtins.

Modified: cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl?rev=324201&r1=324200&r2=324201&view=diff
==
--- cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl Sun Feb  4 14:32:07 2018
@@ -89,3 +89,20 @@ void test_mov_dpp(global int* out, int s
   *out = __builtin_amdgcn_mov_dpp(src, 0, 0, 0, false);
 }
 
+// CHECK-LABEL: @test_ds_fadd
+// CHECK: call float @llvm.amdgcn.ds.fadd(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
+void test_ds_fadd(__attribute__((address_space(3))) float *out, float src) {
+  *out = __builtin_amdgcn_ds_fadd(out, src, 0, 0, false);
+}
+
+// CHECK-LABEL: @test_ds_fmin
+// CHECK: call float @llvm.amdgcn.ds.fmin(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
+void test_ds_fmin(__attribute__((address_space(3))) float *out, float src) {
+  *out = __builtin_amdgcn_ds_fmin(out, src, 0, 0, false);
+}
+
+// CHECK-LABEL: @test_ds_fmax
+// CHECK: call float @llvm.amdgcn.ds.fmax(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
+void test_ds_fmax(__attribute__((address_space(3))) float *out, float src) {
+  *out = __builtin_amdgcn_ds_fmax(out, src, 0, 0, false);
+}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r323890 - [AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions

2018-01-31 Thread Daniil Fukalov via cfe-commits
Author: dfukalov
Date: Wed Jan 31 08:55:09 2018
New Revision: 323890

URL: http://llvm.org/viewvc/llvm-project?rev=323890&view=rev
Log:
[AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions

Reviewed by arsenm

Differential Revision: https://reviews.llvm.org/D42578

Modified:
cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl

Modified: cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def?rev=323890&r1=323889&r2=323890&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def Wed Jan 31 08:55:09 2018
@@ -93,6 +93,9 @@ BUILTIN(__builtin_amdgcn_ds_bpermute, "i
 BUILTIN(__builtin_amdgcn_readfirstlane, "ii", "nc")
 BUILTIN(__builtin_amdgcn_readlane, "iii", "nc")
 BUILTIN(__builtin_amdgcn_fmed3f, "", "nc")
+BUILTIN(__builtin_amdgcn_ds_fadd, "ff*3fiib", "n")
+BUILTIN(__builtin_amdgcn_ds_fmin, "ff*3fiib", "n")
+BUILTIN(__builtin_amdgcn_ds_fmax, "ff*3fiib", "n")
 
 
//===--===//
 // VI+ only builtins.

Modified: cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl?rev=323890&r1=323889&r2=323890&view=diff
==
--- cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl Wed Jan 31 08:55:09 2018
@@ -89,3 +89,23 @@ void test_mov_dpp(global int* out, int s
   *out = __builtin_amdgcn_mov_dpp(src, 0, 0, 0, false);
 }
 
+// CHECK-LABEL: @test_ds_fadd
+// CHECK: call float @llvm.amdgcn.ds.fadd(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
+void test_ds_fadd(local float *out, float src)
+{
+  *out = __builtin_amdgcn_ds_fadd(out, src, 0, 0, false);
+}
+
+// CHECK-LABEL: @test_ds_fmin
+// CHECK: call float @llvm.amdgcn.ds.fmin(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
+void test_ds_fmin(local float *out, float src)
+{
+  *out = __builtin_amdgcn_ds_fmin(out, src, 0, 0, false);
+}
+
+// CHECK-LABEL: @test_ds_fmax
+// CHECK: call float @llvm.amdgcn.ds.fmax(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
+void test_ds_fmax(local float *out, float src)
+{
+  *out = __builtin_amdgcn_ds_fmax(out, src, 0, 0, false);
+}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r323896 - Revert "[AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions"

2018-02-01 Thread Daniil Fukalov via cfe-commits
Author: dfukalov
Date: Wed Jan 31 10:49:49 2018
New Revision: 323896

URL: http://llvm.org/viewvc/llvm-project?rev=323896&view=rev
Log:
Revert "[AMDGPU] Add ds_fadd, ds_fmin, ds_fmax builtins functions"

This reverts https://reviews.llvm.org/rL323890

This reverts commit 251524ebd8c346a936f0e74b09d609d49fbaae4a.

Modified:
cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl

Modified: cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def?rev=323896&r1=323895&r2=323896&view=diff
==
--- cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsAMDGPU.def Wed Jan 31 10:49:49 2018
@@ -93,9 +93,6 @@ BUILTIN(__builtin_amdgcn_ds_bpermute, "i
 BUILTIN(__builtin_amdgcn_readfirstlane, "ii", "nc")
 BUILTIN(__builtin_amdgcn_readlane, "iii", "nc")
 BUILTIN(__builtin_amdgcn_fmed3f, "", "nc")
-BUILTIN(__builtin_amdgcn_ds_fadd, "ff*3fiib", "n")
-BUILTIN(__builtin_amdgcn_ds_fmin, "ff*3fiib", "n")
-BUILTIN(__builtin_amdgcn_ds_fmax, "ff*3fiib", "n")
 
 
//===--===//
 // VI+ only builtins.

Modified: cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl?rev=323896&r1=323895&r2=323896&view=diff
==
--- cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl (original)
+++ cfe/trunk/test/CodeGenOpenCL/builtins-amdgcn-vi.cl Wed Jan 31 10:49:49 2018
@@ -89,23 +89,3 @@ void test_mov_dpp(global int* out, int s
   *out = __builtin_amdgcn_mov_dpp(src, 0, 0, 0, false);
 }
 
-// CHECK-LABEL: @test_ds_fadd
-// CHECK: call float @llvm.amdgcn.ds.fadd(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
-void test_ds_fadd(local float *out, float src)
-{
-  *out = __builtin_amdgcn_ds_fadd(out, src, 0, 0, false);
-}
-
-// CHECK-LABEL: @test_ds_fmin
-// CHECK: call float @llvm.amdgcn.ds.fmin(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
-void test_ds_fmin(local float *out, float src)
-{
-  *out = __builtin_amdgcn_ds_fmin(out, src, 0, 0, false);
-}
-
-// CHECK-LABEL: @test_ds_fmax
-// CHECK: call float @llvm.amdgcn.ds.fmax(float addrspace(3)* %out, float 
%src, i32 0, i32 0, i1 false)
-void test_ds_fmax(local float *out, float src)
-{
-  *out = __builtin_amdgcn_ds_fmax(out, src, 0, 0, false);
-}


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-09-03 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/106810

>From 0221e97459534f0f7396e7970663e1a4f1f98cca Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Sat, 31 Aug 2024 01:45:27 +0200
Subject: [PATCH 1/2] [NFC] Add explicit #include llvm-config.h where its
 macros are used, part 2.

Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects.
For example, `clagd` may report even `llvm-config.h` as "no used" in case it 
defines a macro, that is expicitly used with #ifdef.
It is actually amplified with different build configs which use different set 
of macros.
---
 bolt/include/bolt/Core/BinaryBasicBlock.h | 1 +
 clang-tools-extra/clangd/Feature.cpp  | 1 +
 clang-tools-extra/clangd/unittests/ClangdTests.cpp| 1 +
 clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp   | 1 +
 clang-tools-extra/clangd/unittests/SerializationTests.cpp | 1 +
 clang/include/clang/Interpreter/Value.h   | 1 +
 clang/lib/Driver/ToolChains/Cuda.cpp  | 1 +
 clang/lib/Driver/ToolChains/MinGW.cpp | 1 +
 clang/lib/Driver/ToolChains/WebAssembly.cpp   | 1 +
 clang/lib/Frontend/FrontendActions.cpp| 1 +
 clang/tools/driver/driver.cpp | 2 ++
 clang/unittests/Driver/GCCVersionTest.cpp | 1 +
 lld/ELF/OutputSections.cpp| 2 +-
 lldb/source/API/SBDebugger.cpp| 1 +
 lldb/source/Host/common/Host.cpp  | 1 +
 .../Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 1 +
 .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp   | 1 +
 lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp  | 1 +
 lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp  | 1 +
 lldb/unittests/Host/MainLoopTest.cpp  | 1 +
 llvm/include/llvm/Debuginfod/HTTPClient.h | 1 +
 llvm/include/llvm/Debuginfod/HTTPServer.h | 1 +
 llvm/include/llvm/Support/ErrorHandling.h | 1 +
 llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp| 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp | 1 +
 llvm/lib/Analysis/ModelUnderTrainingRunner.cpp| 1 +
 llvm/lib/Analysis/TFLiteUtils.cpp | 1 +
 llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp   | 1 +
 llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp| 1 +
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp  | 1 +
 llvm/lib/DebugInfo/PDB/PDB.cpp| 1 +
 llvm/lib/Debuginfod/HTTPClient.cpp| 1 +
 llvm/lib/Debuginfod/HTTPServer.cpp| 1 +
 llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp | 1 +
 llvm/lib/IR/Core.cpp  | 1 +
 llvm/lib/MC/SPIRVObjectWriter.cpp | 1 +
 llvm/lib/Support/CRC.cpp  | 1 +
 llvm/lib/Support/Compression.cpp  | 1 +
 llvm/lib/Support/Z3Solver.cpp | 1 +
 llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 1 +
 llvm/lib/TargetParser/Unix/Host.inc   | 1 +
 llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp| 1 +
 llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp| 1 +
 .../Analysis/InlineAdvisorPlugin/InlineAdvisorPlugin.cpp  | 4 ++--
 .../Analysis/InlineOrderPlugin/InlineOrderPlugin.cpp  | 4 ++--
 llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp   | 1 +
 llvm/unittests/Analysis/PluginInlineOrderAnalysisTest.cpp | 1 +
 llvm/unittests/Debuginfod/HTTPServerTests.cpp | 1 +
 llvm/unittests/Passes/Plugins/PluginsTest.cpp | 1 +
 llvm/unittests/Support/CompressionTest.cpp| 1 +
 llvm/unittests/TargetParser/Host.cpp  | 2 +-
 llvm/unittests/tools/llvm-profdata/OutputSizeLimitTest.cpp| 1 +
 mlir/include/mlir/Bytecode/BytecodeWriter.h   | 1 +
 mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp| 1 +
 mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp| 1 +
 polly/lib/Support/RegisterPasses.cpp  | 1 +
 59 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/bolt/include/bolt/Core/BinaryBasicBlock.h 
b/bolt/include/bolt/Core/BinaryBasicBlock.h
index 9a9d7b8735d714..b4f31cf2bae6f6 100644
--- a/bolt/include/bolt/Core/BinaryBasicBlock.h
+++ 

[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-09-04 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/106810

>From 0221e97459534f0f7396e7970663e1a4f1f98cca Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Sat, 31 Aug 2024 01:45:27 +0200
Subject: [PATCH 1/3] [NFC] Add explicit #include llvm-config.h where its
 macros are used, part 2.

Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects.
For example, `clagd` may report even `llvm-config.h` as "no used" in case it 
defines a macro, that is expicitly used with #ifdef.
It is actually amplified with different build configs which use different set 
of macros.
---
 bolt/include/bolt/Core/BinaryBasicBlock.h | 1 +
 clang-tools-extra/clangd/Feature.cpp  | 1 +
 clang-tools-extra/clangd/unittests/ClangdTests.cpp| 1 +
 clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp   | 1 +
 clang-tools-extra/clangd/unittests/SerializationTests.cpp | 1 +
 clang/include/clang/Interpreter/Value.h   | 1 +
 clang/lib/Driver/ToolChains/Cuda.cpp  | 1 +
 clang/lib/Driver/ToolChains/MinGW.cpp | 1 +
 clang/lib/Driver/ToolChains/WebAssembly.cpp   | 1 +
 clang/lib/Frontend/FrontendActions.cpp| 1 +
 clang/tools/driver/driver.cpp | 2 ++
 clang/unittests/Driver/GCCVersionTest.cpp | 1 +
 lld/ELF/OutputSections.cpp| 2 +-
 lldb/source/API/SBDebugger.cpp| 1 +
 lldb/source/Host/common/Host.cpp  | 1 +
 .../Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 1 +
 .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp   | 1 +
 lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp  | 1 +
 lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp  | 1 +
 lldb/unittests/Host/MainLoopTest.cpp  | 1 +
 llvm/include/llvm/Debuginfod/HTTPClient.h | 1 +
 llvm/include/llvm/Debuginfod/HTTPServer.h | 1 +
 llvm/include/llvm/Support/ErrorHandling.h | 1 +
 llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp| 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp | 1 +
 llvm/lib/Analysis/ModelUnderTrainingRunner.cpp| 1 +
 llvm/lib/Analysis/TFLiteUtils.cpp | 1 +
 llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp   | 1 +
 llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp| 1 +
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp  | 1 +
 llvm/lib/DebugInfo/PDB/PDB.cpp| 1 +
 llvm/lib/Debuginfod/HTTPClient.cpp| 1 +
 llvm/lib/Debuginfod/HTTPServer.cpp| 1 +
 llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp | 1 +
 llvm/lib/IR/Core.cpp  | 1 +
 llvm/lib/MC/SPIRVObjectWriter.cpp | 1 +
 llvm/lib/Support/CRC.cpp  | 1 +
 llvm/lib/Support/Compression.cpp  | 1 +
 llvm/lib/Support/Z3Solver.cpp | 1 +
 llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 1 +
 llvm/lib/TargetParser/Unix/Host.inc   | 1 +
 llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp| 1 +
 llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp| 1 +
 .../Analysis/InlineAdvisorPlugin/InlineAdvisorPlugin.cpp  | 4 ++--
 .../Analysis/InlineOrderPlugin/InlineOrderPlugin.cpp  | 4 ++--
 llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp   | 1 +
 llvm/unittests/Analysis/PluginInlineOrderAnalysisTest.cpp | 1 +
 llvm/unittests/Debuginfod/HTTPServerTests.cpp | 1 +
 llvm/unittests/Passes/Plugins/PluginsTest.cpp | 1 +
 llvm/unittests/Support/CompressionTest.cpp| 1 +
 llvm/unittests/TargetParser/Host.cpp  | 2 +-
 llvm/unittests/tools/llvm-profdata/OutputSizeLimitTest.cpp| 1 +
 mlir/include/mlir/Bytecode/BytecodeWriter.h   | 1 +
 mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp| 1 +
 mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp| 1 +
 polly/lib/Support/RegisterPasses.cpp  | 1 +
 59 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/bolt/include/bolt/Core/BinaryBasicBlock.h 
b/bolt/include/bolt/Core/BinaryBasicBlock.h
index 9a9d7b8735d714..b4f31cf2bae6f6 100644
--- a/bolt/include/bolt/Core/BinaryBasicBlock.h
+++ 

[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

2024-09-04 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov created 
https://github.com/llvm/llvm-project/pull/107301

(this is clang related part)

Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects. For example, `clagd` may 
report even `llvm-config.h` as "no used" in case it defines a macro, that is 
explicitly used with #ifdef. It is actually amplified with different build 
configs which use different set of macros.

>From f14f604ac3b7dc758de4cb553142f61122fc584f Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Wed, 4 Sep 2024 22:11:24 +0200
Subject: [PATCH] [NFC] Add explicit #include llvm-config.h where its macros
 are used, clang part.

(clang related part)
Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects.
For example, `clagd` may report even `llvm-config.h` as "no used" in case it 
defines a macro, that is expicitly used with #ifdef.
It is actually amplified with different build configs which use different set 
of macros.
---
 clang-tools-extra/clangd/Feature.cpp| 1 +
 clang-tools-extra/clangd/unittests/ClangdTests.cpp  | 1 +
 clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp | 1 +
 clang-tools-extra/clangd/unittests/SerializationTests.cpp   | 1 +
 clang/include/clang/Interpreter/Value.h | 1 +
 clang/lib/Driver/ToolChains/Cuda.cpp| 1 +
 clang/lib/Driver/ToolChains/MinGW.cpp   | 1 +
 clang/lib/Driver/ToolChains/WebAssembly.cpp | 1 +
 clang/lib/Frontend/FrontendActions.cpp  | 1 +
 clang/tools/driver/driver.cpp   | 2 ++
 clang/unittests/Driver/GCCVersionTest.cpp   | 1 +
 11 files changed, 12 insertions(+)

diff --git a/clang-tools-extra/clangd/Feature.cpp 
b/clang-tools-extra/clangd/Feature.cpp
index 859618a7470aca..ec707a33f656be 100644
--- a/clang-tools-extra/clangd/Feature.cpp
+++ b/clang-tools-extra/clangd/Feature.cpp
@@ -8,6 +8,7 @@
 
 #include "Feature.h"
 #include "clang/Basic/Version.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Host.h"
 
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp 
b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index c324643498d94c..643b8e9f12d751 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -29,6 +29,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Path.h"
diff --git a/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp 
b/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp
index b64dd4acad4c22..2ce2975bd962bc 100644
--- a/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp
+++ b/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp
@@ -18,6 +18,7 @@
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
diff --git a/clang-tools-extra/clangd/unittests/SerializationTests.cpp 
b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
index 35a2e2ba77a659..2a7a6c36d3d17f 100644
--- a/clang-tools-extra/clangd/unittests/SerializationTests.cpp
+++ b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
@@ -12,6 +12,7 @@
 #include "support/Logger.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Compression.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ScopedPrinter.h"
diff --git a/clang/include/clang/Interpreter/Value.h 
b/clang/include/clang/Interpreter/Value.h
index d70e8f8719026b..a93c0841915fc2 100644
--- a/clang/include/clang/Interpreter/Value.h
+++ b/clang/include/clang/Interpreter/Value.h
@@ -33,6 +33,7 @@
 #ifndef LLVM_CLANG_INTERPRETER_VALUE_H
 #define LLVM_CLANG_INTERPRETER_VALUE_H
 
+#include "llvm/Config/llvm-config.h" // for LLVM_BUILD_LLVM_DYLIB, 
LLVM_BUILD_SHARED_LIBS
 #include "llvm/Support/Compiler.h"
 #include 
 
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp 
b/clang/lib/Driver/ToolChains/Cuda.cpp
index 3f9885b196ec55..ef44ffa5594daf 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -17,6 +17,7 @@
 #include "clang/Driver/InputInfo.h"
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_HOST_TRIPLE
 #include "llvm/Option/ArgList.h"
 #include "llvm/Support/FileSystem.h"
 #include "ll

[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-09-04 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov ready_for_review 
https://github.com/llvm/llvm-project/pull/106810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-09-04 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/106810

>From 7e9c4b1d0da02cf923a790c8025ac1e1a333094e Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Sat, 31 Aug 2024 01:45:27 +0200
Subject: [PATCH 1/3] [NFC] Add explicit #include llvm-config.h where its
 macros are used, part 2.

Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects.
For example, `clagd` may report even `llvm-config.h` as "no used" in case it 
defines a macro, that is expicitly used with #ifdef.
It is actually amplified with different build configs which use different set 
of macros.
---
 bolt/include/bolt/Core/BinaryBasicBlock.h | 1 +
 clang-tools-extra/clangd/Feature.cpp  | 1 +
 clang-tools-extra/clangd/unittests/ClangdTests.cpp| 1 +
 clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp   | 1 +
 clang-tools-extra/clangd/unittests/SerializationTests.cpp | 1 +
 clang/include/clang/Interpreter/Value.h   | 1 +
 clang/lib/Driver/ToolChains/Cuda.cpp  | 1 +
 clang/lib/Driver/ToolChains/MinGW.cpp | 1 +
 clang/lib/Driver/ToolChains/WebAssembly.cpp   | 1 +
 clang/lib/Frontend/FrontendActions.cpp| 1 +
 clang/tools/driver/driver.cpp | 2 ++
 clang/unittests/Driver/GCCVersionTest.cpp | 1 +
 lld/ELF/OutputSections.cpp| 2 +-
 lldb/source/API/SBDebugger.cpp| 1 +
 lldb/source/Host/common/Host.cpp  | 1 +
 .../Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 1 +
 .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp   | 1 +
 lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp  | 1 +
 lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp  | 1 +
 lldb/unittests/Host/MainLoopTest.cpp  | 1 +
 llvm/include/llvm/Debuginfod/HTTPClient.h | 1 +
 llvm/include/llvm/Debuginfod/HTTPServer.h | 1 +
 llvm/include/llvm/Support/ErrorHandling.h | 1 +
 llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp| 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp | 1 +
 llvm/lib/Analysis/ModelUnderTrainingRunner.cpp| 1 +
 llvm/lib/Analysis/TFLiteUtils.cpp | 1 +
 llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp   | 1 +
 llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp| 1 +
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp  | 1 +
 llvm/lib/DebugInfo/PDB/PDB.cpp| 1 +
 llvm/lib/Debuginfod/HTTPClient.cpp| 1 +
 llvm/lib/Debuginfod/HTTPServer.cpp| 1 +
 llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp | 1 +
 llvm/lib/IR/Core.cpp  | 1 +
 llvm/lib/MC/SPIRVObjectWriter.cpp | 1 +
 llvm/lib/Support/CRC.cpp  | 1 +
 llvm/lib/Support/Compression.cpp  | 1 +
 llvm/lib/Support/Z3Solver.cpp | 1 +
 llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 1 +
 llvm/lib/TargetParser/Unix/Host.inc   | 1 +
 llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp| 1 +
 llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp| 1 +
 .../Analysis/InlineAdvisorPlugin/InlineAdvisorPlugin.cpp  | 4 ++--
 .../Analysis/InlineOrderPlugin/InlineOrderPlugin.cpp  | 4 ++--
 llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp   | 1 +
 llvm/unittests/Analysis/PluginInlineOrderAnalysisTest.cpp | 1 +
 llvm/unittests/Debuginfod/HTTPServerTests.cpp | 1 +
 llvm/unittests/Passes/Plugins/PluginsTest.cpp | 1 +
 llvm/unittests/Support/CompressionTest.cpp| 1 +
 llvm/unittests/TargetParser/Host.cpp  | 2 +-
 llvm/unittests/tools/llvm-profdata/OutputSizeLimitTest.cpp| 1 +
 mlir/include/mlir/Bytecode/BytecodeWriter.h   | 1 +
 mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp| 1 +
 mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp| 1 +
 polly/lib/Support/RegisterPasses.cpp  | 1 +
 59 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/bolt/include/bolt/Core/BinaryBasicBlock.h 
b/bolt/include/bolt/Core/BinaryBasicBlock.h
index 9a9d7b8735d714..b4f31cf2bae6f6 100644
--- a/bolt/include/bolt/Core/BinaryBasicBlock.h
+++ 

[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

2024-09-04 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov ready_for_review 
https://github.com/llvm/llvm-project/pull/107301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

2024-09-04 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/107301

>From f955f992b39bfcbdd7d200664678d4c1884c2fd4 Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Wed, 4 Sep 2024 22:11:24 +0200
Subject: [PATCH] [NFC] Add explicit #include llvm-config.h where its macros
 are used, clang part.

(clang related part)
Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects.
For example, `clagd` may report even `llvm-config.h` as "no used" in case it 
defines a macro, that is expicitly used with #ifdef.
It is actually amplified with different build configs which use different set 
of macros.
---
 clang-tools-extra/clangd/Feature.cpp| 1 +
 clang-tools-extra/clangd/unittests/ClangdTests.cpp  | 1 +
 clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp | 1 +
 clang-tools-extra/clangd/unittests/SerializationTests.cpp   | 1 +
 clang/include/clang/Interpreter/Value.h | 1 +
 clang/lib/Driver/ToolChains/Cuda.cpp| 1 +
 clang/lib/Driver/ToolChains/MinGW.cpp   | 1 +
 clang/lib/Driver/ToolChains/WebAssembly.cpp | 1 +
 clang/lib/Frontend/FrontendActions.cpp  | 1 +
 clang/tools/driver/driver.cpp   | 2 ++
 clang/unittests/Driver/GCCVersionTest.cpp   | 1 +
 11 files changed, 12 insertions(+)

diff --git a/clang-tools-extra/clangd/Feature.cpp 
b/clang-tools-extra/clangd/Feature.cpp
index 859618a7470aca..ec707a33f656be 100644
--- a/clang-tools-extra/clangd/Feature.cpp
+++ b/clang-tools-extra/clangd/Feature.cpp
@@ -8,6 +8,7 @@
 
 #include "Feature.h"
 #include "clang/Basic/Version.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Compiler.h"
 #include "llvm/TargetParser/Host.h"
 
diff --git a/clang-tools-extra/clangd/unittests/ClangdTests.cpp 
b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
index c324643498d94c..643b8e9f12d751 100644
--- a/clang-tools-extra/clangd/unittests/ClangdTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ClangdTests.cpp
@@ -29,6 +29,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringMap.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/Path.h"
diff --git a/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp 
b/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp
index b64dd4acad4c22..2ce2975bd962bc 100644
--- a/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp
+++ b/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp
@@ -18,6 +18,7 @@
 #include "llvm/ADT/ScopeExit.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
 #include "llvm/Support/Process.h"
diff --git a/clang-tools-extra/clangd/unittests/SerializationTests.cpp 
b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
index 35a2e2ba77a659..2a7a6c36d3d17f 100644
--- a/clang-tools-extra/clangd/unittests/SerializationTests.cpp
+++ b/clang-tools-extra/clangd/unittests/SerializationTests.cpp
@@ -12,6 +12,7 @@
 #include "support/Logger.h"
 #include "clang/Tooling/CompilationDatabase.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
 #include "llvm/Support/Compression.h"
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ScopedPrinter.h"
diff --git a/clang/include/clang/Interpreter/Value.h 
b/clang/include/clang/Interpreter/Value.h
index d70e8f8719026b..a93c0841915fc2 100644
--- a/clang/include/clang/Interpreter/Value.h
+++ b/clang/include/clang/Interpreter/Value.h
@@ -33,6 +33,7 @@
 #ifndef LLVM_CLANG_INTERPRETER_VALUE_H
 #define LLVM_CLANG_INTERPRETER_VALUE_H
 
+#include "llvm/Config/llvm-config.h" // for LLVM_BUILD_LLVM_DYLIB, 
LLVM_BUILD_SHARED_LIBS
 #include "llvm/Support/Compiler.h"
 #include 
 
diff --git a/clang/lib/Driver/ToolChains/Cuda.cpp 
b/clang/lib/Driver/ToolChains/Cuda.cpp
index 3f9885b196ec55..ef44ffa5594daf 100644
--- a/clang/lib/Driver/ToolChains/Cuda.cpp
+++ b/clang/lib/Driver/ToolChains/Cuda.cpp
@@ -17,6 +17,7 @@
 #include "clang/Driver/InputInfo.h"
 #include "clang/Driver/Options.h"
 #include "llvm/ADT/StringExtras.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_HOST_TRIPLE
 #include "llvm/Option/ArgList.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/FormatAdapters.h"
diff --git a/clang/lib/Driver/ToolChains/MinGW.cpp 
b/clang/lib/Driver/ToolChains/MinGW.cpp
index c81a7ed1702963..85f40893e54247 100644
--- a/clang/lib/Driver/ToolChains/MinGW.cpp
+++ b/clang/lib/Driver/ToolChains/MinGW.cpp
@@ -15,6 +15,7 @@
 #include "clang/Driver/InputInfo.h"
 #include "clang/Driver/Options.h"
 #include "clang/Driver/SanitizerArgs.h"
+

[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-09-06 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/106810

>From 8232271806ea605fb4f7212d842a328307070003 Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Sat, 31 Aug 2024 01:45:27 +0200
Subject: [PATCH 1/3] [NFC] Add explicit #include llvm-config.h where its
 macros are used, part 2.

Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects.
For example, `clagd` may report even `llvm-config.h` as "no used" in case it 
defines a macro, that is expicitly used with #ifdef.
It is actually amplified with different build configs which use different set 
of macros.
---
 bolt/include/bolt/Core/BinaryBasicBlock.h | 1 +
 clang-tools-extra/clangd/Feature.cpp  | 1 +
 clang-tools-extra/clangd/unittests/ClangdTests.cpp| 1 +
 clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp   | 1 +
 clang-tools-extra/clangd/unittests/SerializationTests.cpp | 1 +
 clang/include/clang/Interpreter/Value.h   | 1 +
 clang/lib/Driver/ToolChains/Cuda.cpp  | 1 +
 clang/lib/Driver/ToolChains/MinGW.cpp | 1 +
 clang/lib/Driver/ToolChains/WebAssembly.cpp   | 1 +
 clang/lib/Frontend/FrontendActions.cpp| 1 +
 clang/tools/driver/driver.cpp | 2 ++
 clang/unittests/Driver/GCCVersionTest.cpp | 1 +
 lld/ELF/OutputSections.cpp| 2 +-
 lldb/source/API/SBDebugger.cpp| 1 +
 lldb/source/Host/common/Host.cpp  | 1 +
 .../Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 1 +
 .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp   | 1 +
 lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp  | 1 +
 lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp  | 1 +
 lldb/unittests/Host/MainLoopTest.cpp  | 1 +
 llvm/include/llvm/Debuginfod/HTTPClient.h | 1 +
 llvm/include/llvm/Debuginfod/HTTPServer.h | 1 +
 llvm/include/llvm/Support/ErrorHandling.h | 1 +
 llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp| 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp | 1 +
 llvm/lib/Analysis/ModelUnderTrainingRunner.cpp| 1 +
 llvm/lib/Analysis/TFLiteUtils.cpp | 1 +
 llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp   | 1 +
 llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp| 1 +
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp  | 1 +
 llvm/lib/DebugInfo/PDB/PDB.cpp| 1 +
 llvm/lib/Debuginfod/HTTPClient.cpp| 1 +
 llvm/lib/Debuginfod/HTTPServer.cpp| 1 +
 llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp | 1 +
 llvm/lib/IR/Core.cpp  | 1 +
 llvm/lib/MC/SPIRVObjectWriter.cpp | 1 +
 llvm/lib/Support/CRC.cpp  | 1 +
 llvm/lib/Support/Compression.cpp  | 1 +
 llvm/lib/Support/Z3Solver.cpp | 1 +
 llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 1 +
 llvm/lib/TargetParser/Unix/Host.inc   | 1 +
 llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp| 1 +
 llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp| 1 +
 .../Analysis/InlineAdvisorPlugin/InlineAdvisorPlugin.cpp  | 4 ++--
 .../Analysis/InlineOrderPlugin/InlineOrderPlugin.cpp  | 4 ++--
 llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp   | 1 +
 llvm/unittests/Analysis/PluginInlineOrderAnalysisTest.cpp | 1 +
 llvm/unittests/Debuginfod/HTTPServerTests.cpp | 1 +
 llvm/unittests/Passes/Plugins/PluginsTest.cpp | 1 +
 llvm/unittests/Support/CompressionTest.cpp| 1 +
 llvm/unittests/TargetParser/Host.cpp  | 2 +-
 llvm/unittests/tools/llvm-profdata/OutputSizeLimitTest.cpp| 1 +
 mlir/include/mlir/Bytecode/BytecodeWriter.h   | 1 +
 mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp| 1 +
 mlir/unittests/Target/LLVM/SerializeNVVMTarget.cpp| 1 +
 polly/lib/Support/RegisterPasses.cpp  | 1 +
 59 files changed, 62 insertions(+), 6 deletions(-)

diff --git a/bolt/include/bolt/Core/BinaryBasicBlock.h 
b/bolt/include/bolt/Core/BinaryBasicBlock.h
index 9a9d7b8735d714..b4f31cf2bae6f6 100644
--- a/bolt/include/bolt/Core/BinaryBasicBlock.h
+++ 

[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

2024-09-06 Thread Daniil Fukalov via cfe-commits


@@ -15,6 +15,7 @@
 #include "clang/Driver/InputInfo.h"
 #include "clang/Driver/Options.h"
 #include "clang/Driver/SanitizerArgs.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_HOST_TRIPLE

dfukalov wrote:

Well, I guess such files (with configuration defines only) make almost no 
impact in compile time. It seems reasonable to treat _them_ (only?) just as 
IWYU.

Moreover, this change is a preparation to cleanup. So this include will 
probably appear here, after removal in other (implicitly used from this file) 
place.

https://github.com/llvm/llvm-project/pull/107301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [NFC] Add explicit #include llvm-config.h where its macros are used, clang part. (PR #107301)

2024-09-06 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov closed 
https://github.com/llvm/llvm-project/pull/107301
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update includes in Support lib with IWYU. (PR #102306)

2024-08-09 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov closed 
https://github.com/llvm/llvm-project/pull/102306
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

2024-08-12 Thread Daniil Fukalov via cfe-commits

dfukalov wrote:

> Can you provide more context on the motivation / what you're trying to 
> achieve here?
The motivation is as usual IWYU and similar refactoring - to reduce build time 
and probablility of non-related source(s) recompile.
 
> Did you know that LLVM intentionally does not follow IWYU and favors forward 
> declarations: 
> https://llvm.org/docs/CodingStandards.html#include-as-little-as-possible
Yes, but I actually do not see what part of the mentioned standard' section 
conflicts with the change. Would you please suggest an example where we see a 
situation when applied IWYU approach can contradict with the part of Coding 
Standards?



https://github.com/llvm/llvm-project/pull/102707
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

2024-08-12 Thread Daniil Fukalov via cfe-commits

dfukalov wrote:

> Could you try preprocessing each affected source file (i.e. compile it with 
> -E) and see whether the total number of included source lines goes up or 
> down? I think that would help to demonstrate whether this patch violates the 
> "include as little as possible" philosophy.

The overall preprocessed files size for the whole lb/Support reduced from 
257172 KB to 255369 KB (about 1%)

Anyway, I see the change is too big to review and discuss so I'm going to 
shrink it. I'm not sure is it better to update this PR or create a new one.

https://github.com/llvm/llvm-project/pull/102707
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

2024-08-15 Thread Daniil Fukalov via cfe-commits

dfukalov wrote:

Created other [PR 104484](https://github.com/llvm/llvm-project/pull/104484) 
with reworked/reduced cleanup.


https://github.com/llvm/llvm-project/pull/102707
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [mlir] [NFC][IWYU] Update Support library with IWYU. (PR #102707)

2024-08-15 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov closed 
https://github.com/llvm/llvm-project/pull/102707
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-08-30 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov created 
https://github.com/llvm/llvm-project/pull/106810

This is the second part.

Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects. For example, `clagd` may 
report even `llvm-config.h` as "no used" in case it defines a macro, that is 
expicitly used with #ifdef. It is actually amplified with different build 
configs which use different set of macros.

>From 0221e97459534f0f7396e7970663e1a4f1f98cca Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Sat, 31 Aug 2024 01:45:27 +0200
Subject: [PATCH] [NFC] Add explicit #include llvm-config.h where its macros
 are used, part 2.

Without these explicit includes, removing other headers, who implicitly include 
llvm-config.h, may have non-trivial side effects.
For example, `clagd` may report even `llvm-config.h` as "no used" in case it 
defines a macro, that is expicitly used with #ifdef.
It is actually amplified with different build configs which use different set 
of macros.
---
 bolt/include/bolt/Core/BinaryBasicBlock.h | 1 +
 clang-tools-extra/clangd/Feature.cpp  | 1 +
 clang-tools-extra/clangd/unittests/ClangdTests.cpp| 1 +
 clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp   | 1 +
 clang-tools-extra/clangd/unittests/SerializationTests.cpp | 1 +
 clang/include/clang/Interpreter/Value.h   | 1 +
 clang/lib/Driver/ToolChains/Cuda.cpp  | 1 +
 clang/lib/Driver/ToolChains/MinGW.cpp | 1 +
 clang/lib/Driver/ToolChains/WebAssembly.cpp   | 1 +
 clang/lib/Frontend/FrontendActions.cpp| 1 +
 clang/tools/driver/driver.cpp | 2 ++
 clang/unittests/Driver/GCCVersionTest.cpp | 1 +
 lld/ELF/OutputSections.cpp| 2 +-
 lldb/source/API/SBDebugger.cpp| 1 +
 lldb/source/Host/common/Host.cpp  | 1 +
 .../Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 1 +
 .../Process/gdb-remote/GDBRemoteCommunicationClient.cpp   | 1 +
 lldb/source/Plugins/SymbolFile/CTF/SymbolFileCTF.cpp  | 1 +
 lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp  | 1 +
 lldb/unittests/Host/MainLoopTest.cpp  | 1 +
 llvm/include/llvm/Debuginfod/HTTPClient.h | 1 +
 llvm/include/llvm/Debuginfod/HTTPServer.h | 1 +
 llvm/include/llvm/Support/ErrorHandling.h | 1 +
 llvm/lib/Analysis/DevelopmentModeInlineAdvisor.cpp| 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/InlineSizeEstimatorAnalysis.cpp | 1 +
 llvm/lib/Analysis/ModelUnderTrainingRunner.cpp| 1 +
 llvm/lib/Analysis/TFLiteUtils.cpp | 1 +
 llvm/lib/CodeGen/MLRegAllocEvictAdvisor.cpp   | 1 +
 llvm/lib/CodeGen/MLRegAllocPriorityAdvisor.cpp| 1 +
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp  | 1 +
 llvm/lib/CodeGen/RegAllocPriorityAdvisor.cpp  | 1 +
 llvm/lib/DebugInfo/PDB/PDB.cpp| 1 +
 llvm/lib/Debuginfod/HTTPClient.cpp| 1 +
 llvm/lib/Debuginfod/HTTPServer.cpp| 1 +
 llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoaderVTune.cpp | 1 +
 llvm/lib/IR/Core.cpp  | 1 +
 llvm/lib/MC/SPIRVObjectWriter.cpp | 1 +
 llvm/lib/Support/CRC.cpp  | 1 +
 llvm/lib/Support/Compression.cpp  | 1 +
 llvm/lib/Support/Z3Solver.cpp | 1 +
 llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp | 1 +
 llvm/lib/TargetParser/Unix/Host.inc   | 1 +
 llvm/tools/llvm-libtool-darwin/llvm-libtool-darwin.cpp| 1 +
 llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp| 1 +
 .../Analysis/InlineAdvisorPlugin/InlineAdvisorPlugin.cpp  | 4 ++--
 .../Analysis/InlineOrderPlugin/InlineOrderPlugin.cpp  | 4 ++--
 llvm/unittests/Analysis/PluginInlineAdvisorAnalysisTest.cpp   | 1 +
 llvm/unittests/Analysis/PluginInlineOrderAnalysisTest.cpp | 1 +
 llvm/unittests/Debuginfod/HTTPServerTests.cpp | 1 +
 llvm/unittests/Passes/Plugins/PluginsTest.cpp | 1 +
 llvm/unittests/Support/CompressionTest.cpp| 1 +
 llvm/unittests/TargetParser/Host.cpp  | 2 +-
 llvm/unittests/tools/llvm-profdata/OutputSizeLimitTest.cpp| 1 +
 mlir/include/mlir/Bytecode/BytecodeWriter.h   | 1 +
 mlir/lib/Target/SPIRV/SPIRVBinaryUtils.cpp| 1 +
 mlir/unitt

[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-08-31 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov edited 
https://github.com/llvm/llvm-project/pull/106810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [NFC] Cleanup in Support headers. (PR #104825)

2024-08-19 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov created 
https://github.com/llvm/llvm-project/pull/104825

Remove unused directly includes and forward declarations in Support headers.

>From cce13227c78d3d1831fb8773fc52005fabd412c6 Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Mon, 19 Aug 2024 20:02:52 +0200
Subject: [PATCH] [NFC] Cleanup in Support headers.

Remove unused directly includes and forward declarations in Support headers.
---
 clang/lib/CodeGen/ObjectFilePCHContainerWriter.cpp  | 1 +
 clang/lib/Format/Format.cpp | 1 +
 clang/lib/Format/FormatTokenSource.h| 1 +
 clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp   | 1 +
 clang/tools/driver/driver.cpp   | 1 +
 clang/unittests/Format/MacroCallReconstructorTest.cpp   | 1 +
 lld/ELF/Writer.cpp  | 1 +
 lld/MachO/BPSectionOrderer.cpp  | 1 +
 lld/MachO/Dwarf.cpp | 1 +
 lld/MachO/SectionPriorities.cpp | 1 +
 lld/wasm/WriterUtils.h  | 1 +
 llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h | 1 -
 llvm/include/llvm/Support/Atomic.h  | 2 +-
 llvm/include/llvm/Support/BalancedPartitioning.h| 3 ++-
 llvm/include/llvm/Support/BinaryStreamReader.h  | 1 -
 llvm/include/llvm/Support/BranchProbability.h   | 1 -
 llvm/include/llvm/Support/CRC.h | 2 +-
 llvm/include/llvm/Support/CachePruning.h| 4 +++-
 llvm/include/llvm/Support/Casting.h | 1 -
 llvm/include/llvm/Support/Chrono.h  | 5 +
 llvm/include/llvm/Support/CommandLine.h | 4 
 llvm/include/llvm/Support/Compression.h | 6 --
 llvm/include/llvm/Support/ConvertEBCDIC.h   | 4 +++-
 llvm/include/llvm/Support/DataExtractor.h   | 1 -
 llvm/include/llvm/Support/DebugCounter.h| 4 ++--
 llvm/include/llvm/Support/ELFAttributeParser.h  | 1 -
 llvm/include/llvm/Support/Error.h   | 3 ---
 llvm/include/llvm/Support/ErrorHandling.h   | 2 --
 llvm/include/llvm/Support/ExponentialBackoff.h  | 2 --
 llvm/include/llvm/Support/FileOutputBuffer.h| 1 -
 llvm/include/llvm/Support/FileUtilities.h   | 2 --
 llvm/include/llvm/Support/FormatVariadic.h  | 1 -
 llvm/include/llvm/Support/LineIterator.h| 1 -
 llvm/include/llvm/Support/LockFileManager.h | 1 -
 llvm/include/llvm/Support/MathExtras.h  | 1 -
 llvm/include/llvm/Support/Memory.h  | 1 -
 llvm/include/llvm/Support/OptimizedStructLayout.h   | 3 ++-
 llvm/include/llvm/Support/PGOOptions.h  | 2 +-
 llvm/include/llvm/Support/Path.h| 1 -
 llvm/include/llvm/Support/PrettyStackTrace.h| 1 -
 llvm/include/llvm/Support/Process.h | 1 -
 llvm/include/llvm/Support/RandomNumberGenerator.h   | 2 --
 llvm/include/llvm/Support/ScopedPrinter.h   | 1 -
 llvm/include/llvm/Support/SpecialCaseList.h | 1 -
 llvm/include/llvm/Support/ThreadPool.h  | 3 +--
 llvm/include/llvm/Support/Threading.h   | 1 -
 llvm/include/llvm/Support/Timer.h   | 1 -
 llvm/include/llvm/Support/TypeSize.h| 1 -
 llvm/include/llvm/Support/VirtualFileSystem.h   | 1 -
 llvm/include/llvm/Support/Watchdog.h| 2 --
 llvm/include/llvm/Support/WithColor.h   | 1 -
 llvm/include/llvm/Support/raw_ostream.h | 2 --
 llvm/include/llvm/Testing/ADT/StringMap.h   | 1 -
 llvm/lib/Analysis/AliasAnalysis.cpp | 1 +
 llvm/lib/Analysis/DXILMetadataAnalysis.cpp  | 1 +
 llvm/lib/Analysis/DXILResource.cpp  | 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp | 1 +
 llvm/lib/Analysis/InlineOrder.cpp   | 1 +
 llvm/lib/Analysis/InteractiveModelRunner.cpp| 1 +
 llvm/lib/Analysis/ReplayInlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/StackSafetyAnalysis.cpp   | 1 +
 llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp   | 1 +
 llvm/lib/CodeGen/MachineCFGPrinter.cpp  | 2 +-
 llvm/lib/CodeGen/ReplaceWithVeclib.cpp  | 1 +
 llvm/lib/DebugInfo/BTF/BTFParser.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/OrcABISupport.cp

[clang] [lld] [llvm] [NFC] Cleanup in Support headers. (PR #104825)

2024-08-19 Thread Daniil Fukalov via cfe-commits

dfukalov wrote:

For reference: [compile-time-tracker 
run](https://llvm-compile-time-tracker.com/compare.php?from=82fdfd4aa7f60b1f8e715211b925a7f2bfe57ea9&to=70b88a21f2c8bc26a0178c6ae9aa2b0834e8&stat=instructions%3Au)
 with the change (please check the  instructions:u for "clang build" at the 
bottom).
See also [the per-file 
breakdown](https://llvm-compile-time-tracker.com/compare_clang.php?from=82fdfd4aa7f60b1f8e715211b925a7f2bfe57ea9&to=70b88a21f2c8bc26a0178c6ae9aa2b0834e8&stat=instructions%3Au).

https://github.com/llvm/llvm-project/pull/104825
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [NFC] Cleanup in Support headers. (PR #104825)

2024-08-19 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/104825

>From cce13227c78d3d1831fb8773fc52005fabd412c6 Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Mon, 19 Aug 2024 20:02:52 +0200
Subject: [PATCH 1/2] [NFC] Cleanup in Support headers.

Remove unused directly includes and forward declarations in Support headers.
---
 clang/lib/CodeGen/ObjectFilePCHContainerWriter.cpp  | 1 +
 clang/lib/Format/Format.cpp | 1 +
 clang/lib/Format/FormatTokenSource.h| 1 +
 clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp   | 1 +
 clang/tools/driver/driver.cpp   | 1 +
 clang/unittests/Format/MacroCallReconstructorTest.cpp   | 1 +
 lld/ELF/Writer.cpp  | 1 +
 lld/MachO/BPSectionOrderer.cpp  | 1 +
 lld/MachO/Dwarf.cpp | 1 +
 lld/MachO/SectionPriorities.cpp | 1 +
 lld/wasm/WriterUtils.h  | 1 +
 llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h | 1 -
 llvm/include/llvm/Support/Atomic.h  | 2 +-
 llvm/include/llvm/Support/BalancedPartitioning.h| 3 ++-
 llvm/include/llvm/Support/BinaryStreamReader.h  | 1 -
 llvm/include/llvm/Support/BranchProbability.h   | 1 -
 llvm/include/llvm/Support/CRC.h | 2 +-
 llvm/include/llvm/Support/CachePruning.h| 4 +++-
 llvm/include/llvm/Support/Casting.h | 1 -
 llvm/include/llvm/Support/Chrono.h  | 5 +
 llvm/include/llvm/Support/CommandLine.h | 4 
 llvm/include/llvm/Support/Compression.h | 6 --
 llvm/include/llvm/Support/ConvertEBCDIC.h   | 4 +++-
 llvm/include/llvm/Support/DataExtractor.h   | 1 -
 llvm/include/llvm/Support/DebugCounter.h| 4 ++--
 llvm/include/llvm/Support/ELFAttributeParser.h  | 1 -
 llvm/include/llvm/Support/Error.h   | 3 ---
 llvm/include/llvm/Support/ErrorHandling.h   | 2 --
 llvm/include/llvm/Support/ExponentialBackoff.h  | 2 --
 llvm/include/llvm/Support/FileOutputBuffer.h| 1 -
 llvm/include/llvm/Support/FileUtilities.h   | 2 --
 llvm/include/llvm/Support/FormatVariadic.h  | 1 -
 llvm/include/llvm/Support/LineIterator.h| 1 -
 llvm/include/llvm/Support/LockFileManager.h | 1 -
 llvm/include/llvm/Support/MathExtras.h  | 1 -
 llvm/include/llvm/Support/Memory.h  | 1 -
 llvm/include/llvm/Support/OptimizedStructLayout.h   | 3 ++-
 llvm/include/llvm/Support/PGOOptions.h  | 2 +-
 llvm/include/llvm/Support/Path.h| 1 -
 llvm/include/llvm/Support/PrettyStackTrace.h| 1 -
 llvm/include/llvm/Support/Process.h | 1 -
 llvm/include/llvm/Support/RandomNumberGenerator.h   | 2 --
 llvm/include/llvm/Support/ScopedPrinter.h   | 1 -
 llvm/include/llvm/Support/SpecialCaseList.h | 1 -
 llvm/include/llvm/Support/ThreadPool.h  | 3 +--
 llvm/include/llvm/Support/Threading.h   | 1 -
 llvm/include/llvm/Support/Timer.h   | 1 -
 llvm/include/llvm/Support/TypeSize.h| 1 -
 llvm/include/llvm/Support/VirtualFileSystem.h   | 1 -
 llvm/include/llvm/Support/Watchdog.h| 2 --
 llvm/include/llvm/Support/WithColor.h   | 1 -
 llvm/include/llvm/Support/raw_ostream.h | 2 --
 llvm/include/llvm/Testing/ADT/StringMap.h   | 1 -
 llvm/lib/Analysis/AliasAnalysis.cpp | 1 +
 llvm/lib/Analysis/DXILMetadataAnalysis.cpp  | 1 +
 llvm/lib/Analysis/DXILResource.cpp  | 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp | 1 +
 llvm/lib/Analysis/InlineOrder.cpp   | 1 +
 llvm/lib/Analysis/InteractiveModelRunner.cpp| 1 +
 llvm/lib/Analysis/ReplayInlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/StackSafetyAnalysis.cpp   | 1 +
 llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp   | 1 +
 llvm/lib/CodeGen/MachineCFGPrinter.cpp  | 2 +-
 llvm/lib/CodeGen/ReplaceWithVeclib.cpp  | 1 +
 llvm/lib/DebugInfo/BTF/BTFParser.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoader

[clang] [lld] [llvm] [NFC] Cleanup in Support headers. (PR #104825)

2024-08-20 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/104825

>From cce13227c78d3d1831fb8773fc52005fabd412c6 Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Mon, 19 Aug 2024 20:02:52 +0200
Subject: [PATCH 1/4] [NFC] Cleanup in Support headers.

Remove unused directly includes and forward declarations in Support headers.
---
 clang/lib/CodeGen/ObjectFilePCHContainerWriter.cpp  | 1 +
 clang/lib/Format/Format.cpp | 1 +
 clang/lib/Format/FormatTokenSource.h| 1 +
 clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp   | 1 +
 clang/tools/driver/driver.cpp   | 1 +
 clang/unittests/Format/MacroCallReconstructorTest.cpp   | 1 +
 lld/ELF/Writer.cpp  | 1 +
 lld/MachO/BPSectionOrderer.cpp  | 1 +
 lld/MachO/Dwarf.cpp | 1 +
 lld/MachO/SectionPriorities.cpp | 1 +
 lld/wasm/WriterUtils.h  | 1 +
 llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h | 1 -
 llvm/include/llvm/Support/Atomic.h  | 2 +-
 llvm/include/llvm/Support/BalancedPartitioning.h| 3 ++-
 llvm/include/llvm/Support/BinaryStreamReader.h  | 1 -
 llvm/include/llvm/Support/BranchProbability.h   | 1 -
 llvm/include/llvm/Support/CRC.h | 2 +-
 llvm/include/llvm/Support/CachePruning.h| 4 +++-
 llvm/include/llvm/Support/Casting.h | 1 -
 llvm/include/llvm/Support/Chrono.h  | 5 +
 llvm/include/llvm/Support/CommandLine.h | 4 
 llvm/include/llvm/Support/Compression.h | 6 --
 llvm/include/llvm/Support/ConvertEBCDIC.h   | 4 +++-
 llvm/include/llvm/Support/DataExtractor.h   | 1 -
 llvm/include/llvm/Support/DebugCounter.h| 4 ++--
 llvm/include/llvm/Support/ELFAttributeParser.h  | 1 -
 llvm/include/llvm/Support/Error.h   | 3 ---
 llvm/include/llvm/Support/ErrorHandling.h   | 2 --
 llvm/include/llvm/Support/ExponentialBackoff.h  | 2 --
 llvm/include/llvm/Support/FileOutputBuffer.h| 1 -
 llvm/include/llvm/Support/FileUtilities.h   | 2 --
 llvm/include/llvm/Support/FormatVariadic.h  | 1 -
 llvm/include/llvm/Support/LineIterator.h| 1 -
 llvm/include/llvm/Support/LockFileManager.h | 1 -
 llvm/include/llvm/Support/MathExtras.h  | 1 -
 llvm/include/llvm/Support/Memory.h  | 1 -
 llvm/include/llvm/Support/OptimizedStructLayout.h   | 3 ++-
 llvm/include/llvm/Support/PGOOptions.h  | 2 +-
 llvm/include/llvm/Support/Path.h| 1 -
 llvm/include/llvm/Support/PrettyStackTrace.h| 1 -
 llvm/include/llvm/Support/Process.h | 1 -
 llvm/include/llvm/Support/RandomNumberGenerator.h   | 2 --
 llvm/include/llvm/Support/ScopedPrinter.h   | 1 -
 llvm/include/llvm/Support/SpecialCaseList.h | 1 -
 llvm/include/llvm/Support/ThreadPool.h  | 3 +--
 llvm/include/llvm/Support/Threading.h   | 1 -
 llvm/include/llvm/Support/Timer.h   | 1 -
 llvm/include/llvm/Support/TypeSize.h| 1 -
 llvm/include/llvm/Support/VirtualFileSystem.h   | 1 -
 llvm/include/llvm/Support/Watchdog.h| 2 --
 llvm/include/llvm/Support/WithColor.h   | 1 -
 llvm/include/llvm/Support/raw_ostream.h | 2 --
 llvm/include/llvm/Testing/ADT/StringMap.h   | 1 -
 llvm/lib/Analysis/AliasAnalysis.cpp | 1 +
 llvm/lib/Analysis/DXILMetadataAnalysis.cpp  | 1 +
 llvm/lib/Analysis/DXILResource.cpp  | 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp | 1 +
 llvm/lib/Analysis/InlineOrder.cpp   | 1 +
 llvm/lib/Analysis/InteractiveModelRunner.cpp| 1 +
 llvm/lib/Analysis/ReplayInlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/StackSafetyAnalysis.cpp   | 1 +
 llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp   | 1 +
 llvm/lib/CodeGen/MachineCFGPrinter.cpp  | 2 +-
 llvm/lib/CodeGen/ReplaceWithVeclib.cpp  | 1 +
 llvm/lib/DebugInfo/BTF/BTFParser.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoader

[clang] [lld] [llvm] [NFC] Cleanup in Support headers. (PR #104825)

2024-08-20 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov updated 
https://github.com/llvm/llvm-project/pull/104825

>From cce13227c78d3d1831fb8773fc52005fabd412c6 Mon Sep 17 00:00:00 2001
From: dfukalov 
Date: Mon, 19 Aug 2024 20:02:52 +0200
Subject: [PATCH 1/5] [NFC] Cleanup in Support headers.

Remove unused directly includes and forward declarations in Support headers.
---
 clang/lib/CodeGen/ObjectFilePCHContainerWriter.cpp  | 1 +
 clang/lib/Format/Format.cpp | 1 +
 clang/lib/Format/FormatTokenSource.h| 1 +
 clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp   | 1 +
 clang/tools/driver/driver.cpp   | 1 +
 clang/unittests/Format/MacroCallReconstructorTest.cpp   | 1 +
 lld/ELF/Writer.cpp  | 1 +
 lld/MachO/BPSectionOrderer.cpp  | 1 +
 lld/MachO/Dwarf.cpp | 1 +
 lld/MachO/SectionPriorities.cpp | 1 +
 lld/wasm/WriterUtils.h  | 1 +
 llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h | 1 -
 llvm/include/llvm/Support/Atomic.h  | 2 +-
 llvm/include/llvm/Support/BalancedPartitioning.h| 3 ++-
 llvm/include/llvm/Support/BinaryStreamReader.h  | 1 -
 llvm/include/llvm/Support/BranchProbability.h   | 1 -
 llvm/include/llvm/Support/CRC.h | 2 +-
 llvm/include/llvm/Support/CachePruning.h| 4 +++-
 llvm/include/llvm/Support/Casting.h | 1 -
 llvm/include/llvm/Support/Chrono.h  | 5 +
 llvm/include/llvm/Support/CommandLine.h | 4 
 llvm/include/llvm/Support/Compression.h | 6 --
 llvm/include/llvm/Support/ConvertEBCDIC.h   | 4 +++-
 llvm/include/llvm/Support/DataExtractor.h   | 1 -
 llvm/include/llvm/Support/DebugCounter.h| 4 ++--
 llvm/include/llvm/Support/ELFAttributeParser.h  | 1 -
 llvm/include/llvm/Support/Error.h   | 3 ---
 llvm/include/llvm/Support/ErrorHandling.h   | 2 --
 llvm/include/llvm/Support/ExponentialBackoff.h  | 2 --
 llvm/include/llvm/Support/FileOutputBuffer.h| 1 -
 llvm/include/llvm/Support/FileUtilities.h   | 2 --
 llvm/include/llvm/Support/FormatVariadic.h  | 1 -
 llvm/include/llvm/Support/LineIterator.h| 1 -
 llvm/include/llvm/Support/LockFileManager.h | 1 -
 llvm/include/llvm/Support/MathExtras.h  | 1 -
 llvm/include/llvm/Support/Memory.h  | 1 -
 llvm/include/llvm/Support/OptimizedStructLayout.h   | 3 ++-
 llvm/include/llvm/Support/PGOOptions.h  | 2 +-
 llvm/include/llvm/Support/Path.h| 1 -
 llvm/include/llvm/Support/PrettyStackTrace.h| 1 -
 llvm/include/llvm/Support/Process.h | 1 -
 llvm/include/llvm/Support/RandomNumberGenerator.h   | 2 --
 llvm/include/llvm/Support/ScopedPrinter.h   | 1 -
 llvm/include/llvm/Support/SpecialCaseList.h | 1 -
 llvm/include/llvm/Support/ThreadPool.h  | 3 +--
 llvm/include/llvm/Support/Threading.h   | 1 -
 llvm/include/llvm/Support/Timer.h   | 1 -
 llvm/include/llvm/Support/TypeSize.h| 1 -
 llvm/include/llvm/Support/VirtualFileSystem.h   | 1 -
 llvm/include/llvm/Support/Watchdog.h| 2 --
 llvm/include/llvm/Support/WithColor.h   | 1 -
 llvm/include/llvm/Support/raw_ostream.h | 2 --
 llvm/include/llvm/Testing/ADT/StringMap.h   | 1 -
 llvm/lib/Analysis/AliasAnalysis.cpp | 1 +
 llvm/lib/Analysis/DXILMetadataAnalysis.cpp  | 1 +
 llvm/lib/Analysis/DXILResource.cpp  | 1 +
 llvm/lib/Analysis/InlineAdvisor.cpp | 1 +
 llvm/lib/Analysis/InlineOrder.cpp   | 1 +
 llvm/lib/Analysis/InteractiveModelRunner.cpp| 1 +
 llvm/lib/Analysis/ReplayInlineAdvisor.cpp   | 1 +
 llvm/lib/Analysis/StackSafetyAnalysis.cpp   | 1 +
 llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp   | 1 +
 llvm/lib/CodeGen/MachineCFGPrinter.cpp  | 2 +-
 llvm/lib/CodeGen/ReplaceWithVeclib.cpp  | 1 +
 llvm/lib/DebugInfo/BTF/BTFParser.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFLocationExpression.cpp| 1 +
 llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/OrcABISupport.cpp  | 1 +
 llvm/lib/ExecutionEngine/Orc/TargetProcess/JITLoader

[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2024-09-16 Thread Daniil Fukalov via cfe-commits

dfukalov wrote:

Gentle ping...

https://github.com/llvm/llvm-project/pull/106810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [lld] [llvm] [NFC] Cleanup in Support headers. (PR #104825)

2025-03-25 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov closed 
https://github.com/llvm/llvm-project/pull/104825
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [clang-tools-extra] [lld] [lldb] [llvm] [mlir] [polly] [NFC] Add explicit #include llvm-config.h where its macros are used. (PR #106810)

2025-03-25 Thread Daniil Fukalov via cfe-commits

https://github.com/dfukalov closed 
https://github.com/llvm/llvm-project/pull/106810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits