Re: [PATCH] D78192: Support compiler extensions as a normal component

2020-04-24 Thread Michael Kruse via cfe-commits
Weird. I already tried the patch under Windows/msvc and had no such problem.

Michael

Am Fr., 24. Apr. 2020 um 04:15 Uhr schrieb Russell Gallop
:
>
> Hi Serge,
>
> It looks like this is failing to build on Windows bots (e.g. 
> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/32003).
>  Error below.
>
> Please could you take a look?
>
> Thanks
> Russ
>
> FAILED: tools/llvm-config/CMakeFiles/llvm-config.dir/llvm-config.cpp.obj 
> C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\cl.exe
>  /nologo /TP -DBUILD_EXAMPLES -DCMAKE_CFG_INTDIR=\".\" -DGTEST_HAS_RTTI=0 
> -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS 
> -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0 
> -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE 
> -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS 
> -Itools\llvm-config 
> -IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\tools\llvm-config
>  -Iinclude 
> -IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\include
>  /DWIN32 /D_WINDOWS /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 
> -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 
> -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 
> -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 
> -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 
> -we4238 /Gw /MD /O2 /Ob2 /EHs-c- /GR- -UNDEBUG -std:c++14 /showIncludes 
> /Fotools\llvm-config\CMakeFiles\llvm-config.dir\llvm-config.cpp.obj 
> /Fdtools\llvm-config\CMakeFiles\llvm-config.dir\ /FS -c 
> C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\tools\llvm-config\llvm-config.cpp
>  tools\llvm-config\ExtensionDependencies.inc(6): error C2280: 
> 'ExtensionDescriptor::ExtensionDescriptor(void)': attempting to reference a 
> deleted function tools\llvm-config\ExtensionDependencies.inc(5): note: 
> compiler has generated 'ExtensionDescriptor::ExtensionDescriptor' here 
> tools\llvm-config\ExtensionDependencies.inc(5): note: 
> 'ExtensionDescriptor::ExtensionDescriptor(void)': function was implicitly 
> deleted because 'ExtensionDescriptor' has an uninitialized const-qualified 
> data member 'ExtensionDescriptor::RequiredLibraries' 
> tools\llvm-config\ExtensionDependencies.inc(4): note: see declaration of 
> 'ExtensionDescriptor::RequiredLibraries'
>
> On Fri, 24 Apr 2020 at 09:02, serge via Phabricator via cfe-commits 
>  wrote:
>>
>> This revision was automatically updated to reflect the committed changes.
>> Closed by commit rG8f766e382b77: Update compiler extension integration into 
>> the build system (authored by serge-sans-paille).
>>
>> Changed prior to commit:
>>   https://reviews.llvm.org/D78192?vs=259495=259827#toc
>>
>> Repository:
>>   rG LLVM Github Monorepo
>>
>> CHANGES SINCE LAST ACTION
>>   https://reviews.llvm.org/D78192/new/
>>
>> https://reviews.llvm.org/D78192
>>
>> Files:
>>   clang/lib/CodeGen/CMakeLists.txt
>>   llvm/cmake/modules/AddLLVM.cmake
>>   llvm/lib/CMakeLists.txt
>>   llvm/lib/Extensions/CMakeLists.txt
>>   llvm/lib/Extensions/Extensions.cpp
>>   llvm/lib/Extensions/LLVMBuild.txt
>>   llvm/lib/LLVMBuild.txt
>>   llvm/lib/LTO/CMakeLists.txt
>>   llvm/lib/LTO/LLVMBuild.txt
>>   llvm/tools/bugpoint/CMakeLists.txt
>>   llvm/tools/llvm-config/llvm-config.cpp
>>   llvm/tools/opt/CMakeLists.txt
>>
>> ___
>> cfe-commits mailing list
>> cfe-commits@lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-24 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment.

The patch landed without much errors, only added the patchset 
e307eeba0137700e75893089cf0de03383d851ca 



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192



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


Re: [PATCH] D78192: Support compiler extensions as a normal component

2020-04-24 Thread Russell Gallop via cfe-commits
Thanks!

On Fri, 24 Apr 2020 at 10:51, Serge Guelton  wrote:

> On Fri, Apr 24, 2020 at 10:15:15AM +0100, Russell Gallop wrote:
> > Hi Serge,
> >
> > It looks like this is failing to build on Windows bots (e.g. [1]http://
> >
> lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/
> > builds/32003). Error below.
> >
> > Please could you take a look?
>
> e307eeba0137700e75893089cf0de03383d851ca should do the trick (finger
> crossed)
>
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D78192: Support compiler extensions as a normal component

2020-04-24 Thread Serge Guelton via cfe-commits
On Fri, Apr 24, 2020 at 10:15:15AM +0100, Russell Gallop wrote:
> Hi Serge,
> 
> It looks like this is failing to build on Windows bots (e.g. [1]http://
> lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/
> builds/32003). Error below.
> 
> Please could you take a look?

e307eeba0137700e75893089cf0de03383d851ca should do the trick (finger crossed)

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


Re: [PATCH] D78192: Support compiler extensions as a normal component

2020-04-24 Thread Serge Guelton via cfe-commits
On Fri, Apr 24, 2020 at 10:15:15AM +0100, Russell Gallop wrote:
> Hi Serge,
> 
> It looks like this is failing to build on Windows bots (e.g. [1]http://
> lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/
> builds/32003). Error below.
> 
> Please could you take a look?

Sure, thanks for reaching me!

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


Re: [PATCH] D78192: Support compiler extensions as a normal component

2020-04-24 Thread Russell Gallop via cfe-commits
Hi Serge,

It looks like this is failing to build on Windows bots (e.g.
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/32003).
Error below.

Please could you take a look?

Thanks
Russ

FAILED: tools/llvm-config/CMakeFiles/llvm-config.dir/llvm-config.cpp.obj
C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1425~1.286\bin\Hostx64\x64\cl.exe
/nologo /TP -DBUILD_EXAMPLES -DCMAKE_CFG_INTDIR=\".\" -DGTEST_HAS_RTTI=0
-DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_HAS_EXCEPTIONS=0
-D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-Itools\llvm-config
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\tools\llvm-config
-Iinclude
-IC:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\include
/DWIN32 /D_WINDOWS /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4
-wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458
-wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610
-wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611
-wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062
-we4238 /Gw /MD /O2 /Ob2 /EHs-c- /GR- -UNDEBUG -std:c++14 /showIncludes
/Fotools\llvm-config\CMakeFiles\llvm-config.dir\llvm-config.cpp.obj
/Fdtools\llvm-config\CMakeFiles\llvm-config.dir\ /FS -c
C:\ps4-buildslave2\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm-project\llvm\tools\llvm-config\llvm-config.cpp
tools\llvm-config\ExtensionDependencies.inc(6): error C2280:
'ExtensionDescriptor::ExtensionDescriptor(void)': attempting to reference a
deleted function tools\llvm-config\ExtensionDependencies.inc(5): note:
compiler has generated 'ExtensionDescriptor::ExtensionDescriptor' here
tools\llvm-config\ExtensionDependencies.inc(5): note:
'ExtensionDescriptor::ExtensionDescriptor(void)': function was implicitly
deleted because 'ExtensionDescriptor' has an uninitialized const-qualified
data member 'ExtensionDescriptor::RequiredLibraries'
tools\llvm-config\ExtensionDependencies.inc(4): note: see declaration of
'ExtensionDescriptor::RequiredLibraries'

On Fri, 24 Apr 2020 at 09:02, serge via Phabricator via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> This revision was automatically updated to reflect the committed changes.
> Closed by commit rG8f766e382b77: Update compiler extension integration
> into the build system (authored by serge-sans-paille).
>
> Changed prior to commit:
>   https://reviews.llvm.org/D78192?vs=259495=259827#toc
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D78192/new/
>
> https://reviews.llvm.org/D78192
>
> Files:
>   clang/lib/CodeGen/CMakeLists.txt
>   llvm/cmake/modules/AddLLVM.cmake
>   llvm/lib/CMakeLists.txt
>   llvm/lib/Extensions/CMakeLists.txt
>   llvm/lib/Extensions/Extensions.cpp
>   llvm/lib/Extensions/LLVMBuild.txt
>   llvm/lib/LLVMBuild.txt
>   llvm/lib/LTO/CMakeLists.txt
>   llvm/lib/LTO/LLVMBuild.txt
>   llvm/tools/bugpoint/CMakeLists.txt
>   llvm/tools/llvm-config/llvm-config.cpp
>   llvm/tools/opt/CMakeLists.txt
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-24 Thread serge via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8f766e382b77: Update compiler extension integration into the 
build system (authored by serge-sans-paille).

Changed prior to commit:
  https://reviews.llvm.org/D78192?vs=259495=259827#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192

Files:
  clang/lib/CodeGen/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/lib/CMakeLists.txt
  llvm/lib/Extensions/CMakeLists.txt
  llvm/lib/Extensions/Extensions.cpp
  llvm/lib/Extensions/LLVMBuild.txt
  llvm/lib/LLVMBuild.txt
  llvm/lib/LTO/CMakeLists.txt
  llvm/lib/LTO/LLVMBuild.txt
  llvm/tools/bugpoint/CMakeLists.txt
  llvm/tools/llvm-config/llvm-config.cpp
  llvm/tools/opt/CMakeLists.txt

Index: llvm/tools/opt/CMakeLists.txt
===
--- llvm/tools/opt/CMakeLists.txt
+++ llvm/tools/opt/CMakeLists.txt
@@ -9,6 +9,7 @@
   CodeGen
   Core
   Coroutines
+  Extensions
   IPO
   IRReader
   InstCombine
@@ -33,8 +34,6 @@
   PrintSCC.cpp
   opt.cpp
 
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   SUPPORT_PLUGINS
Index: llvm/tools/llvm-config/llvm-config.cpp
===
--- llvm/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -46,6 +46,10 @@
 // create entries for pseudo groups like x86 or all-targets.
 #include "LibraryDependencies.inc"
 
+// Built-in extensions also register their dependencies, but in a separate file,
+// later in the process.
+#include "ExtensionDependencies.inc"
+
 // LinkMode determines what libraries and flags are returned by llvm-config.
 enum LinkMode {
   // LinkModeAuto will link with the default link mode for the installation,
@@ -110,6 +114,25 @@
GetComponentLibraryPath, Missing, DirSep);
   }
 
+  // Special handling for the special 'extensions' component. Its content is
+  // not populated by llvm-build, but later in the process and loaded from
+  // ExtensionDependencies.inc.
+  if (Name == "extensions") {
+for (auto const  : AvailableExtensions) {
+  for (const char *const *Iter = [0];
+   *Iter; ++Iter) {
+AvailableComponent *AC = ComponentMap.lookup(*Iter);
+if (!AC) {
+  RequiredLibs.push_back(*Iter);
+} else {
+  VisitComponent(*Iter, ComponentMap, VisitedComponents, RequiredLibs,
+ IncludeNonInstalled, GetComponentNames,
+ GetComponentLibraryPath, Missing, DirSep);
+}
+  }
+}
+  }
+
   if (GetComponentNames) {
 RequiredLibs.push_back(Name);
 return;
Index: llvm/tools/bugpoint/CMakeLists.txt
===
--- llvm/tools/bugpoint/CMakeLists.txt
+++ llvm/tools/bugpoint/CMakeLists.txt
@@ -6,6 +6,7 @@
   Analysis
   BitWriter
   CodeGen
+  Extensions
   Core
   IPO
   IRReader
@@ -32,8 +33,6 @@
   ToolRunner.cpp
   bugpoint.cpp
 
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   SUPPORT_PLUGINS
Index: llvm/lib/LTO/CMakeLists.txt
===
--- llvm/lib/LTO/CMakeLists.txt
+++ llvm/lib/LTO/CMakeLists.txt
@@ -10,9 +10,6 @@
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/LTO
-
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   llvm_vcsrevision_h
Index: llvm/lib/LLVMBuild.txt
===
--- llvm/lib/LLVMBuild.txt
+++ llvm/lib/LLVMBuild.txt
@@ -25,6 +25,7 @@
  Demangle
  DWARFLinker
  ExecutionEngine
+ Extensions
  Frontend
  FuzzMutate
  LineEditor
Index: llvm/lib/LTO/LLVMBuild.txt
===
--- llvm/lib/LTO/LLVMBuild.txt
+++ llvm/lib/LTO/LLVMBuild.txt
@@ -26,6 +26,7 @@
  BitWriter
  CodeGen
  Core
+ Extensions
  IPO
  InstCombine
  Linker
Index: llvm/lib/Extensions/LLVMBuild.txt
===
--- llvm/lib/Extensions/LLVMBuild.txt
+++ llvm/lib/Extensions/LLVMBuild.txt
@@ -1,4 +1,4 @@
-;===- ./lib/LTO/LLVMBuild.txt --*- Conf -*--===;
+;===- ./lib/Extensions/LLVMBuild.txt ---*- Conf -*--===;
 ;
 ; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
 ; See https://llvm.org/LICENSE.txt for license information.
@@ -16,25 +16,6 @@
 
 [component_0]
 type = Library
-name = LTO
+name = Extensions
 parent = Libraries
 required_libraries =
- AggressiveInstCombine
- Analysis
- BinaryFormat
- BitReader
- BitWriter
- CodeGen
- Core
- IPO
- InstCombine
- Linker
- MC
- ObjCARC
- Object
- Passes
- Remarks
- Scalar
- Support
- Target
- TransformUtils
Index: llvm/lib/Extensions/CMakeLists.txt
===
--- /dev/null
+++ 

[PATCH] D78192: Support compiler extensions as a normal component

2020-04-23 Thread Michael Kruse via Phabricator via cfe-commits
Meinersbur accepted this revision.
Meinersbur added a comment.
This revision is now accepted and ready to land.

LGTM.

As with every change to the build system, please look out broken configurations 
after committing. You will have noticed already that there is a lot of variety 
in how others build LLVM, and its not possible for one person to test them all.




Comment at: llvm/cmake/modules/AddLLVM.cmake:952-953
+
+  ## Part 2: Extension header that captures each extension dependency, to 
be
+  #  by llvm-config.
+  set(ExtensionDeps 
"${LLVM_BINARY_DIR}/tools/llvm-config/ExtensionDependencies.inc")

[typo] double 'be'



Comment at: llvm/cmake/modules/AddLLVM.cmake:959
+  foreach(llvm_extension ${LLVM_STATIC_EXTENSIONS})
+get_property(llvm_plugin_deps TARGET ${llvm_extension} PROPERTY 
LINK_LIBRARIES)
+list(LENGTH llvm_plugin_deps llvm_plugin_deps_length)

In contrast to the LLVMBuild.txt system, this actually uses cmake to get the 
dependency. Very cool! I am not sure whether `LINK_LIBRARIES` also includes 
transitive dependencies.

I think the community would love to see the LLVMBuild.txt gone completely. 
Interested in working on that?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192



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


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 259495.
serge-sans-paille added a comment.

Fix dependency order for extension libraries, as spotted by @Meinersbur


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192

Files:
  clang/lib/CodeGen/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/lib/CMakeLists.txt
  llvm/lib/Extensions/CMakeLists.txt
  llvm/lib/Extensions/Extensions.cpp
  llvm/lib/Extensions/LLVMBuild.txt
  llvm/lib/LLVMBuild.txt
  llvm/lib/LTO/CMakeLists.txt
  llvm/lib/LTO/LLVMBuild.txt
  llvm/tools/bugpoint/CMakeLists.txt
  llvm/tools/llvm-config/llvm-config.cpp
  llvm/tools/opt/CMakeLists.txt

Index: llvm/tools/opt/CMakeLists.txt
===
--- llvm/tools/opt/CMakeLists.txt
+++ llvm/tools/opt/CMakeLists.txt
@@ -9,6 +9,7 @@
   CodeGen
   Core
   Coroutines
+  Extensions
   IPO
   IRReader
   InstCombine
@@ -33,8 +34,6 @@
   PrintSCC.cpp
   opt.cpp
 
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   SUPPORT_PLUGINS
Index: llvm/tools/llvm-config/llvm-config.cpp
===
--- llvm/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -46,6 +46,10 @@
 // create entries for pseudo groups like x86 or all-targets.
 #include "LibraryDependencies.inc"
 
+// Built-in extensions also register their dependencies, but in a separate file,
+// later in the process.
+#include "ExtensionDependencies.inc"
+
 // LinkMode determines what libraries and flags are returned by llvm-config.
 enum LinkMode {
   // LinkModeAuto will link with the default link mode for the installation,
@@ -110,6 +114,25 @@
GetComponentLibraryPath, Missing, DirSep);
   }
 
+  // Special handling for the special 'extensions' component. Its content is
+  // not populated by llvm-build, but later in the process and loaded from
+  // ExtensionDependencies.inc.
+  if (Name == "extensions") {
+for (auto const  : AvailableExtensions) {
+  for (const char *const *Iter = [0];
+   *Iter; ++Iter) {
+AvailableComponent *AC = ComponentMap.lookup(*Iter);
+if (!AC) {
+  RequiredLibs.push_back(*Iter);
+} else {
+  VisitComponent(*Iter, ComponentMap, VisitedComponents, RequiredLibs,
+ IncludeNonInstalled, GetComponentNames,
+ GetComponentLibraryPath, Missing, DirSep);
+}
+  }
+}
+  }
+
   if (GetComponentNames) {
 RequiredLibs.push_back(Name);
 return;
Index: llvm/tools/bugpoint/CMakeLists.txt
===
--- llvm/tools/bugpoint/CMakeLists.txt
+++ llvm/tools/bugpoint/CMakeLists.txt
@@ -6,6 +6,7 @@
   Analysis
   BitWriter
   CodeGen
+  Extensions
   Core
   IPO
   IRReader
@@ -32,8 +33,6 @@
   ToolRunner.cpp
   bugpoint.cpp
 
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   SUPPORT_PLUGINS
Index: llvm/lib/LTO/LLVMBuild.txt
===
--- llvm/lib/LTO/LLVMBuild.txt
+++ llvm/lib/LTO/LLVMBuild.txt
@@ -26,6 +26,7 @@
  BitWriter
  CodeGen
  Core
+ Extensions
  IPO
  InstCombine
  Linker
Index: llvm/lib/LTO/CMakeLists.txt
===
--- llvm/lib/LTO/CMakeLists.txt
+++ llvm/lib/LTO/CMakeLists.txt
@@ -10,9 +10,6 @@
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/LTO
-
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   llvm_vcsrevision_h
Index: llvm/lib/LLVMBuild.txt
===
--- llvm/lib/LLVMBuild.txt
+++ llvm/lib/LLVMBuild.txt
@@ -25,6 +25,7 @@
  Demangle
  DWARFLinker
  ExecutionEngine
+ Extensions
  Frontend
  FuzzMutate
  LineEditor
Index: llvm/lib/Extensions/LLVMBuild.txt
===
--- /dev/null
+++ llvm/lib/Extensions/LLVMBuild.txt
@@ -0,0 +1,21 @@
+;===- ./lib/Extensions/LLVMBuild.txt ---*- Conf -*--===;
+;
+; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+; See https://llvm.org/LICENSE.txt for license information.
+; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+;
+;======;
+;
+; This is an LLVMBuild description file for the components in this subdirectory.
+;
+; For more information on the LLVMBuild system, please see:
+;
+;   http://llvm.org/docs/LLVMBuild.html
+;
+;======;
+
+[component_0]
+type = Library
+name = Extensions
+parent = Libraries
+required_libraries =
Index: llvm/lib/Extensions/CMakeLists.txt
===
--- /dev/null
+++ llvm/lib/Extensions/CMakeLists.txt
@@ -0,0 +1,3 @@
+add_llvm_component_library(LLVMExtensions
+

[PATCH] D78192: Support compiler extensions as a normal component

2020-04-23 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment.

In D78192#1997698 , @Meinersbur wrote:

> Is this ready to try out?


It is!

> 
> 
> In D78192#1996859 , 
> @serge-sans-paille wrote:
> 
>> Note that this should solve in an elegant (?) way the multiple link errors 
>> found when linking clang with LLVM_DYLIB.
> 
> 
> Aren't these fixed already?

Indeed, but the fix is not generic (it made change to the polly Cmake code), 
and it's not compatible with Polly declaring component dependencies (see 
https://reviews.llvm.org/D78358).
Anyway, that's just a side effect of the cleanup, didn't want to emphazise too 
much on that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192



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


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-22 Thread Michael Kruse via Phabricator via cfe-commits
Meinersbur added a comment.

I looks to work fine under my Windows and Linux configuration. One Point though:

  llvm-config --libs Extensions

returns

  [...] -lPollyPPCG -lPollyISL -lPolly

I think `-lPolly` must be first to work with bfd.ld order semantics. See 
https://stackoverflow.com/questions/45135/why-does-the-order-in-which-libraries-are-linked-sometimes-cause-errors-in-gcc
 , lld and Microsoft's link.exe don't care less about the order.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192



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


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-22 Thread Michael Kruse via Phabricator via cfe-commits
Meinersbur added a comment.

Is this ready to try out?

In D78192#1996859 , @serge-sans-paille 
wrote:

> Note that this should solve in an elegant (?) way the multiple link errors 
> found when linking clang with LLVM_DYLIB.


Aren't these fixed already?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192



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


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-22 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment.

Note that this should solve in an elegant (?) way the multiple link errors 
found when linking clang with LLVM_DYLIB.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192



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


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-22 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment.

@Meinersbur with the latest updat, it should also be compatible with 
https://github.com/intel/opencl-clang/blob/83837744ef076c1285ed2ee9349febc2208d3252/CMakeLists.txt#L266
 as all contains the `Extensions` component.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192



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


[PATCH] D78192: Support compiler extensions as a normal component

2020-04-22 Thread serge via Phabricator via cfe-commits
serge-sans-paille updated this revision to Diff 259284.
serge-sans-paille added a comment.
Herald added subscribers: cfe-commits, dang, dexonsmith, steven_wu, hiraditya.
Herald added a project: clang.

Instead of linking all compiler extensions to the different possible tagets 
(clang, opt lto etc), link them in a new component, named ` Extensions`. That 
way a tool (or component) that needs to use compiler extension can just declare 
that dependency in the traditional way.

This is compatible with llvm-build and llvm-config, through a specific handler 
in llvm-config though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78192/new/

https://reviews.llvm.org/D78192

Files:
  clang/lib/CodeGen/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/lib/CMakeLists.txt
  llvm/lib/Extensions/CMakeLists.txt
  llvm/lib/Extensions/Extensions.cpp
  llvm/lib/Extensions/LLVMBuild.txt
  llvm/lib/LLVMBuild.txt
  llvm/lib/LTO/CMakeLists.txt
  llvm/lib/LTO/LLVMBuild.txt
  llvm/tools/bugpoint/CMakeLists.txt
  llvm/tools/llvm-config/llvm-config.cpp
  llvm/tools/opt/CMakeLists.txt

Index: llvm/tools/opt/CMakeLists.txt
===
--- llvm/tools/opt/CMakeLists.txt
+++ llvm/tools/opt/CMakeLists.txt
@@ -9,6 +9,7 @@
   CodeGen
   Core
   Coroutines
+  Extensions
   IPO
   IRReader
   InstCombine
@@ -33,8 +34,6 @@
   PrintSCC.cpp
   opt.cpp
 
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   SUPPORT_PLUGINS
Index: llvm/tools/llvm-config/llvm-config.cpp
===
--- llvm/tools/llvm-config/llvm-config.cpp
+++ llvm/tools/llvm-config/llvm-config.cpp
@@ -46,6 +46,10 @@
 // create entries for pseudo groups like x86 or all-targets.
 #include "LibraryDependencies.inc"
 
+// Built-in extensions also register their dependencies, but in a separate file,
+// later in the process.
+#include "ExtensionDependencies.inc"
+
 // LinkMode determines what libraries and flags are returned by llvm-config.
 enum LinkMode {
   // LinkModeAuto will link with the default link mode for the installation,
@@ -110,6 +114,25 @@
GetComponentLibraryPath, Missing, DirSep);
   }
 
+  // Special handling for the special 'extensions' component. Its content is
+  // not populated by llvm-build, but later in the process and loaded from
+  // ExtensionDependencies.inc.
+  if (Name == "extensions") {
+for (auto const  : AvailableExtensions) {
+  for (const char *const *Iter = [0];
+   *Iter; ++Iter) {
+AvailableComponent *AC = ComponentMap.lookup(*Iter);
+if (!AC) {
+  RequiredLibs.push_back(*Iter);
+} else {
+  VisitComponent(*Iter, ComponentMap, VisitedComponents, RequiredLibs,
+ IncludeNonInstalled, GetComponentNames,
+ GetComponentLibraryPath, Missing, DirSep);
+}
+  }
+}
+  }
+
   if (GetComponentNames) {
 RequiredLibs.push_back(Name);
 return;
Index: llvm/tools/bugpoint/CMakeLists.txt
===
--- llvm/tools/bugpoint/CMakeLists.txt
+++ llvm/tools/bugpoint/CMakeLists.txt
@@ -6,6 +6,7 @@
   Analysis
   BitWriter
   CodeGen
+  Extensions
   Core
   IPO
   IRReader
@@ -32,8 +33,6 @@
   ToolRunner.cpp
   bugpoint.cpp
 
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   SUPPORT_PLUGINS
Index: llvm/lib/LTO/LLVMBuild.txt
===
--- llvm/lib/LTO/LLVMBuild.txt
+++ llvm/lib/LTO/LLVMBuild.txt
@@ -26,6 +26,7 @@
  BitWriter
  CodeGen
  Core
+ Extensions
  IPO
  InstCombine
  Linker
Index: llvm/lib/LTO/CMakeLists.txt
===
--- llvm/lib/LTO/CMakeLists.txt
+++ llvm/lib/LTO/CMakeLists.txt
@@ -10,9 +10,6 @@
 
   ADDITIONAL_HEADER_DIRS
   ${LLVM_MAIN_INCLUDE_DIR}/llvm/LTO
-
-  ENABLE_PLUGINS
-
   DEPENDS
   intrinsics_gen
   llvm_vcsrevision_h
Index: llvm/lib/LLVMBuild.txt
===
--- llvm/lib/LLVMBuild.txt
+++ llvm/lib/LLVMBuild.txt
@@ -25,6 +25,7 @@
  Demangle
  DWARFLinker
  ExecutionEngine
+ Extensions
  Frontend
  FuzzMutate
  LineEditor
Index: llvm/lib/Extensions/LLVMBuild.txt
===
--- /dev/null
+++ llvm/lib/Extensions/LLVMBuild.txt
@@ -0,0 +1,21 @@
+;===- ./lib/Extensions/LLVMBuild.txt ---*- Conf -*--===;
+;
+; Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+; See https://llvm.org/LICENSE.txt for license information.
+; SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+;
+;======;
+;
+; This is an LLVMBuild description file for the components in this subdirectory.
+;
+; For more information on the LLVMBuild system, please see:
+;