[PATCH] D143813: [ClangFE] Check that __sync builtins are naturally aligned.

2023-10-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

This introduced a build failure on s390x: 
https://github.com/llvm/llvm-project/issues/69146


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

https://reviews.llvm.org/D143813

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


[PATCH] D156599: [profiling] Move option declarations into headers

2023-09-30 Thread Tom Stellard via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe7247f1010b5: [profiling] Move option declarations into 
headers (authored by tstellar).

Changed prior to commit:
  https://reviews.llvm.org/D156599?vs=545375=557514#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156599

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  llvm/include/llvm/ProfileData/ProfileCommon.h
  llvm/include/llvm/Transforms/IPO/SampleProfile.h
  llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
  llvm/lib/Analysis/ProfileSummaryInfo.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/tools/llvm-profgen/CSPreInliner.cpp

Index: llvm/tools/llvm-profgen/CSPreInliner.cpp
===
--- llvm/tools/llvm-profgen/CSPreInliner.cpp
+++ llvm/tools/llvm-profgen/CSPreInliner.cpp
@@ -11,6 +11,7 @@
 #include "llvm/ADT/SCCIterator.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
+#include "llvm/Transforms/IPO/SampleProfile.h"
 #include 
 #include 
 
@@ -35,13 +36,6 @@
 // TODO: the actual threshold to be tuned here because the size here is based
 // on machine code not LLVM IR.
 namespace llvm {
-extern cl::opt SampleHotCallSiteThreshold;
-extern cl::opt SampleColdCallSiteThreshold;
-extern cl::opt ProfileInlineGrowthLimit;
-extern cl::opt ProfileInlineLimitMin;
-extern cl::opt ProfileInlineLimitMax;
-extern cl::opt SortProfiledSCC;
-
 cl::opt EnableCSPreInliner(
 "csspgo-preinliner", cl::Hidden, cl::init(true),
 cl::desc("Run a global pre-inliner to merge context profile based on "
Index: llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
===
--- llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -327,7 +327,6 @@
 // Defined in Analysis/BlockFrequencyInfo.cpp:  -view-bfi-func-name=
 extern cl::opt ViewBlockFreqFuncName;
 
-extern cl::opt DebugInfoCorrelate;
 } // namespace llvm
 
 static cl::opt
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -47,6 +47,7 @@
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/TargetParser/Triple.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Utils/ModuleUtils.h"
 #include "llvm/Transforms/Utils/SSAUpdater.h"
 #include 
Index: llvm/lib/Analysis/ProfileSummaryInfo.cpp
===
--- llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -23,16 +23,6 @@
 #include 
 using namespace llvm;
 
-// Knobs for profile summary based thresholds.
-namespace llvm {
-extern cl::opt ProfileSummaryCutoffHot;
-extern cl::opt ProfileSummaryCutoffCold;
-extern cl::opt ProfileSummaryHugeWorkingSetSizeThreshold;
-extern cl::opt ProfileSummaryLargeWorkingSetSizeThreshold;
-extern cl::opt ProfileSummaryHotCount;
-extern cl::opt ProfileSummaryColdCount;
-} // namespace llvm
-
 static cl::opt PartialProfile(
 "partial-profile", cl::Hidden, cl::init(false),
 cl::desc("Specify the current profile is used as a partial profile."));
Index: llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
===
--- llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+++ llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
@@ -18,11 +18,14 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/CommandLine.h"
 #include 
 #include 
 
 namespace llvm {
 
+extern cl::opt DebugInfoCorrelate;
+
 class Function;
 class Instruction;
 class Module;
Index: llvm/include/llvm/Transforms/IPO/SampleProfile.h
===
--- llvm/include/llvm/Transforms/IPO/SampleProfile.h
+++ llvm/include/llvm/Transforms/IPO/SampleProfile.h
@@ -17,12 +17,20 @@
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/CommandLine.h"
 #include 
 
 namespace llvm {
 
 class Module;
 
+extern cl::opt SampleHotCallSiteThreshold;
+extern cl::opt SampleColdCallSiteThreshold;
+extern cl::opt ProfileInlineGrowthLimit;
+extern cl::opt ProfileInlineLimitMin;
+extern cl::opt ProfileInlineLimitMax;
+extern cl::opt SortProfiledSCC;
+
 namespace vfs {
 class FileSystem;
 } // namespace vfs
Index: 

[PATCH] D156599: [profiling] Move option declarations into headers

2023-07-29 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: bogner, dnovillo, hoy, huangjd.
Herald added subscribers: wlei, Enna1, ormris, wenlei, hiraditya.
Herald added a project: All.
tstellar requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

This will make it possible to add visibility attributes to these
variables.  This also fixes some type mismatches between the
declaration and the definition.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156599

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  llvm/include/llvm/ProfileData/ProfileCommon.h
  llvm/include/llvm/Transforms/IPO/SampleProfile.h
  llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
  llvm/lib/Analysis/ProfileSummaryInfo.cpp
  llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
  llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  llvm/tools/llvm-profgen/CSPreInliner.cpp

Index: llvm/tools/llvm-profgen/CSPreInliner.cpp
===
--- llvm/tools/llvm-profgen/CSPreInliner.cpp
+++ llvm/tools/llvm-profgen/CSPreInliner.cpp
@@ -11,6 +11,7 @@
 #include "llvm/ADT/SCCIterator.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/DebugInfo/Symbolize/SymbolizableModule.h"
+#include "llvm/Transforms/IPO/SampleProfile.h"
 #include 
 #include 
 
@@ -35,13 +36,6 @@
 // TODO: the actual threshold to be tuned here because the size here is based
 // on machine code not LLVM IR.
 namespace llvm {
-extern cl::opt SampleHotCallSiteThreshold;
-extern cl::opt SampleColdCallSiteThreshold;
-extern cl::opt ProfileInlineGrowthLimit;
-extern cl::opt ProfileInlineLimitMin;
-extern cl::opt ProfileInlineLimitMax;
-extern cl::opt SortProfiledSCC;
-
 cl::opt EnableCSPreInliner(
 "csspgo-preinliner", cl::Hidden, cl::init(true),
 cl::desc("Run a global pre-inliner to merge context profile based on "
Index: llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
===
--- llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -327,7 +327,6 @@
 // Defined in Analysis/BlockFrequencyInfo.cpp:  -view-bfi-func-name=
 extern cl::opt ViewBlockFreqFuncName;
 
-extern cl::opt DebugInfoCorrelate;
 } // namespace llvm
 
 static cl::opt
Index: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
===
--- llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
+++ llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp
@@ -47,6 +47,7 @@
 #include "llvm/Support/Error.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/TargetParser/Triple.h"
+#include "llvm/Transforms/Instrumentation/PGOInstrumentation.h"
 #include "llvm/Transforms/Utils/ModuleUtils.h"
 #include "llvm/Transforms/Utils/SSAUpdater.h"
 #include 
Index: llvm/lib/Analysis/ProfileSummaryInfo.cpp
===
--- llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -23,16 +23,6 @@
 #include 
 using namespace llvm;
 
-// Knobs for profile summary based thresholds.
-namespace llvm {
-extern cl::opt ProfileSummaryCutoffHot;
-extern cl::opt ProfileSummaryCutoffCold;
-extern cl::opt ProfileSummaryHugeWorkingSetSizeThreshold;
-extern cl::opt ProfileSummaryLargeWorkingSetSizeThreshold;
-extern cl::opt ProfileSummaryHotCount;
-extern cl::opt ProfileSummaryColdCount;
-} // namespace llvm
-
 static cl::opt PartialProfile(
 "partial-profile", cl::Hidden, cl::init(false),
 cl::desc("Specify the current profile is used as a partial profile."));
Index: llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
===
--- llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
+++ llvm/include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
@@ -18,11 +18,14 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
+#include "llvm/Support/CommandLine.h"
 #include 
 #include 
 
 namespace llvm {
 
+extern cl::opt DebugInfoCorrelate;
+
 class Function;
 class Instruction;
 class Module;
Index: llvm/include/llvm/Transforms/IPO/SampleProfile.h
===
--- llvm/include/llvm/Transforms/IPO/SampleProfile.h
+++ llvm/include/llvm/Transforms/IPO/SampleProfile.h
@@ -17,12 +17,20 @@
 #include "llvm/ADT/IntrusiveRefCntPtr.h"
 #include "llvm/IR/PassManager.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/CommandLine.h"
 #include 
 
 namespace llvm {
 
 class Module;
 
+extern cl::opt SampleHotCallSiteThreshold;
+extern cl::opt SampleColdCallSiteThreshold;
+extern cl::opt ProfileInlineGrowthLimit;
+extern cl::opt ProfileInlineLimitMin;
+extern cl::opt ProfileInlineLimitMax;
+extern cl::opt 

[PATCH] D155509: Revert "Remove rdar links; NFC"

2023-07-17 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155509

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


[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-06-09 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D141907#4409973 , @MaskRay wrote:

> In D141907#4094748 , @MaskRay wrote:
>
>> [...]
>> edeaf16f2c2f02d6e43312d48d26d354d87913f3 (2011) added the CMake variable 
>> `CLANG_RESOURCE_DIR` but did not explain why. 
>> In the long term, the CMake variable `CLANG_RESOURCE_DIR` probably should be 
>> removed.
>
> My feeling stays the same. In the long term, we should try removing the CMake 
> variable `CLANG_RESOURCE_DIR`.
> Customizing the variable in a special way will make some `clang/test/Driver` 
> tests fail, I don't know it's healthy for contributors to be aware of this 
> yet-another configure variable for `clang/test/Driver` tests. The 
> `CLANG_RESOURCE_DIR` users should be served by specifying `-resource-dir=` in 
> a configuration file 
> (https://clang.llvm.org/docs/UsersManual.html#configuration-files)

I agree with this

In D141907#4409973 , @MaskRay wrote:

> In D141907#4094748 , @MaskRay wrote:
>
>> [...]
>> edeaf16f2c2f02d6e43312d48d26d354d87913f3 (2011) added the CMake variable 
>> `CLANG_RESOURCE_DIR` but did not explain why. 
>> In the long term, the CMake variable `CLANG_RESOURCE_DIR` probably should be 
>> removed.
>
> My feeling stays the same. In the long term, we should try removing the CMake 
> variable `CLANG_RESOURCE_DIR`.
> Customizing the variable in a special way will make some `clang/test/Driver` 
> tests fail, I don't know it's healthy for contributors to be aware of this 
> yet-another configure variable for `clang/test/Driver` tests. The 
> `CLANG_RESOURCE_DIR` users should be served by specifying `-resource-dir=` in 
> a configuration file 
> (https://clang.llvm.org/docs/UsersManual.html#configuration-files)

I think I agree with you here.  The other problem I see with CLANG_RESOURCE_DIR 
is that it depends on the value of LLVM_LIBDIR_SUFFIX, so it's still 
configurable even without the CLANG_RESOURCE_DIR variable.  I think it would 
make sense to standardize it to /usr/lib/clang rather than 
/usr/lib${LLVM_LBDIR_SUFFIX}/clang.  This is how gcc works and it also ensures 
that clang can find the 32-bit compiler-rt libraries.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D152051: libclang-cpp: Add external visibility attribute to all classes

2023-06-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I chatted with @compnerd on Discord, and I'm going to try to update D109192 
 and get that committed and then come back to 
this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152051

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


[PATCH] D152051: libclang-cpp: Add external visibility attribute to all classes

2023-06-07 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

> ! In D152051#4403167 , @compnerd 
> wrote:
>  Please do not use LLVM_EXTERNAL_VISIBILITY but rather introduce a new macro 
> (this will prevent the use on Windows).

OK, so should I create a clang specific macro for this?  And should it behave 
the same as LLVM_EXTERNAL_VISIBILITLY or do I need to have it expand to 
different values depending on the OS?

> I did write a tool to help with this: https://GitHub.com/compnerd/ids

OK, thanks, I will check this out.




Comment at: clang/include/clang/Format/Format.h:4532
 /// Returns ``true`` if the Style has been set.
-bool getPredefinedStyle(StringRef Name, FormatStyle::LanguageKind Language,
+LLVM_EXTERNAL_VISIBILITY bool getPredefinedStyle(StringRef Name, 
FormatStyle::LanguageKind Language,
 FormatStyle *Style);

HazardyKnusperkeks wrote:
> This doesn't look formatted.
I ran git-clang-format on the patch and it introduced a lot of unrelated 
changes, so I ended up dropping that part of the patch.  I can go through and 
manually discard some of the more intrusive format changes.  Any suggestions on 
which kind of formatting changes to keep and which ones to ignore?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152051

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


[PATCH] D105765: Prepare Compiler-RT for GnuInstallDirs, matching libcxx, document all

2023-06-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.
Herald added a subscriber: Enna1.
Herald added a project: All.



Comment at: compiler-rt/cmake/base-config-ix.cmake:126
+set(COMPILER_RT_INSTALL_DATA_DIR "${default_install_path}" CACHE PATH
+  "Path where compiler-rt data files should be installed.")
 

Was there supposed to be an extend_install_path call here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105765

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


[PATCH] D152051: libclang-cpp: Add external visibility attribute to all classes

2023-06-02 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I was not sure what to do with inline functions and also functions that were 
implemented in the headers, so I did not add the LLVM_EXTERNAL_VISIBILITY macro 
to most of those functions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152051

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


[PATCH] D152051: libclang-cpp: Add external visibility attribute to all classes

2023-06-02 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
Herald added subscribers: cfe-commits, PiotrZSL, luke, steakhal, carlosgalvezp, 
frasercrmck, wenlei, luismarques, apazos, sameer.abuasal, s.egerton, Jim, 
mstorsjo, jocewei, PkmX, arphaman, the_o, brucehoult, MartinMosbeck, rogfer01, 
edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, 
asb, kbarton, nemanjai.
Herald added a reviewer: sscalpone.
Herald added a reviewer: aaron.ballman.
Herald added a reviewer: NoQ.
Herald added a reviewer: ributzka.
Herald added a reviewer: njames93.
Herald added projects: All, clang, clang-format.
Herald added reviewers: rymiel, HazardyKnusperkeks, owenpan, MyDeveloperDay.
tstellar requested review of this revision.
Herald added subscribers: pcwang-thead, MaskRay.
Herald added a reviewer: dang.
Herald added projects: LLVM, clang-tools-extra.
Herald added a comment.

NOTE: Clang-Format Team Automated Review Comment

Your review contains a change to clang/include/clang/Format/Format.h but does 
not contain an update to ClangFormatStyleOptions.rst

ClangFormatStyleOptions.rst is generated via 
clang/docs/tools/dump_format_style.py,  please run this to regenerate the .rst

You can validate that the rst is valid by running.

  ./docs/tools/dump_format_style.py
  mkdir -p html
  /usr/bin/sphinx-build -n ./docs ./html


Herald added a comment.

NOTE: Clang-Format Team Automated Review Comment

It looks like your clang-format review does not contain any unit tests, please 
try to ensure all code changes have a unit test (unless this is an `NFC` or 
refactoring, adding documentation etc..)

Add your unit tests in `clang/unittests/Format` and you can build with `ninja 
FormatTests`.  We recommend using the `verifyFormat(xxx)` format of unit tests 
rather than `EXPECT_EQ` as this will ensure you change is tolerant to random 
whitespace changes (see FormatTest.cpp as an example)

For situations where your change is altering the TokenAnnotator.cpp which can 
happen if you are trying to improve the annotation phase to ensure we are 
correctly identifying the type of a token, please add a token annotator test in 
`TokenAnnotatorTest.cpp`


Also compile with -fvisiblity=hidden.  This in theory should be NFC,
but it's possible I missed adding LLVM_EXTERNAL_VISIBILITY to some of
the symbols.  This is the first step towards reducing the amount of
public symbols exposed in libclang-cpp.so, so in the future we will
be dropping LLVM_EXTERNAL_VISIBILITY from classes and functions that
we don't want to make publicly available.

Before and after symbol counts:

$ nm -gD before/libclang-cpp.so | wc -l
30459
$ nm -gD after/libclang-cpp.so | wc -l
20875


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152051

Files:
  clang-tools-extra/clang-tidy/ClangTidyCheck.h
  clang-tools-extra/clang-tidy/ClangTidyModule.h
  clang/CMakeLists.txt
  clang/include/clang-c/FatalErrorHandler.h
  clang/include/clang/APINotes/APINotesYAMLCompiler.h
  clang/include/clang/APINotes/Types.h
  clang/include/clang/ARCMigrate/ARCMT.h
  clang/include/clang/ARCMigrate/ARCMTActions.h
  clang/include/clang/ARCMigrate/FileRemapper.h
  clang/include/clang/AST/APValue.h
  clang/include/clang/AST/ASTConcept.h
  clang/include/clang/AST/ASTConsumer.h
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/AST/ASTContextAllocate.h
  clang/include/clang/AST/ASTDiagnostic.h
  clang/include/clang/AST/ASTDumper.h
  clang/include/clang/AST/ASTDumperUtils.h
  clang/include/clang/AST/ASTImportError.h
  clang/include/clang/AST/ASTImporter.h
  clang/include/clang/AST/ASTImporterLookupTable.h
  clang/include/clang/AST/ASTImporterSharedState.h
  clang/include/clang/AST/ASTMutationListener.h
  clang/include/clang/AST/ASTNodeTraverser.h
  clang/include/clang/AST/ASTStructuralEquivalence.h
  clang/include/clang/AST/ASTTypeTraits.h
  clang/include/clang/AST/ASTUnresolvedSet.h
  clang/include/clang/AST/ASTVector.h
  clang/include/clang/AST/AbstractBasicReader.h
  clang/include/clang/AST/AbstractBasicWriter.h
  clang/include/clang/AST/Attr.h
  clang/include/clang/AST/AttrIterator.h
  clang/include/clang/AST/AttrVisitor.h
  clang/include/clang/AST/Availability.h
  clang/include/clang/AST/BaseSubobject.h
  clang/include/clang/AST/CXXInheritance.h
  clang/include/clang/AST/CanonicalType.h
  clang/include/clang/AST/CharUnits.h
  clang/include/clang/AST/Comment.h
  clang/include/clang/AST/CommentBriefParser.h
  clang/include/clang/AST/CommentCommandTraits.h
  clang/include/clang/AST/CommentLexer.h
  clang/include/clang/AST/CommentParser.h
  clang/include/clang/AST/CommentSema.h
  clang/include/clang/AST/CommentVisitor.h
  clang/include/clang/AST/ComparisonCategories.h
  clang/include/clang/AST/ComputeDependence.h
  clang/include/clang/AST/CurrentSourceLocExprScope.h
  clang/include/clang/AST/DataCollection.h
  clang/include/clang/AST/Decl.h
  clang/include/clang/AST/DeclAccessPair.h
  clang/include/clang/AST/DeclBase.h
  clang/include/clang/AST/DeclCXX.h
  

[PATCH] D150723: clang/openmp: Fix alignment for ThreadID Address variables

2023-05-31 Thread Tom Stellard via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe88fe8181e36: clang/openmp: Fix alignment for ThreadID 
Address variables (authored by tstellar).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150723

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/test/OpenMP/for_reduction_codegen.cpp


Index: clang/test/OpenMP/for_reduction_codegen.cpp
===
--- clang/test/OpenMP/for_reduction_codegen.cpp
+++ clang/test/OpenMP/for_reduction_codegen.cpp
@@ -1,4 +1,4 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 
UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex 
"__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" 
"pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 
UTC_ARGS: --function-signature --check-globals --include-generated-funcs 
--replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" 
"reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _ 
--global-value-regex ".gomp_critical_user[a-zA-Z_.]+"
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 
-emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s 
--check-prefix=CHECK1
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 
-emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 
-include-pch %t -verify %s -emit-llvm -o - | FileCheck 
-allow-deprecated-dag-overlap %s --check-prefix=CHECK1
@@ -527,6 +527,14 @@
 
 
 #endif
+//.
+// CHECK1: @.gomp_critical_user_.reduction.var = common global [8 x i32] 
zeroinitializer, align 8
+// CHECK1: @.gomp_critical_user_.atomic_reduction.var = common global [8 x 
i32] zeroinitializer, align 8
+//.
+// CHECK3: @.gomp_critical_user_.reduction.var = common global [8 x i32] 
zeroinitializer, align 8
+//.
+// CHECK4: @.gomp_critical_user_.reduction.var = common global [8 x i32] 
zeroinitializer, align 8
+//.
 // CHECK1-LABEL: define {{[^@]+}}@main
 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
 // CHECK1-NEXT:  entry:
Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp
===
--- clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -2143,7 +2143,11 @@
 llvm::Value *CGOpenMPRuntime::getCriticalRegionLock(StringRef CriticalName) {
   std::string Prefix = Twine("gomp_critical_user_", CriticalName).str();
   std::string Name = getName({Prefix, "var"});
-  return OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::GlobalVariable *G = 
OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::Align PtrAlign = 
OMPBuilder.M.getDataLayout().getPointerABIAlignment(G->getAddressSpace());
+  if (PtrAlign > llvm::Align(G->getAlignment()))
+G->setAlignment(PtrAlign);
+  return G;
 }
 
 namespace {


Index: clang/test/OpenMP/for_reduction_codegen.cpp
===
--- clang/test/OpenMP/for_reduction_codegen.cpp
+++ clang/test/OpenMP/for_reduction_codegen.cpp
@@ -1,4 +1,4 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-globals --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _ --global-value-regex ".gomp_critical_user[a-zA-Z_.]+"
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
@@ -527,6 +527,14 @@
 
 
 #endif
+//.
+// CHECK1: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
+// CHECK1: @.gomp_critical_user_.atomic_reduction.var = common global [8 x i32] zeroinitializer, align 8
+//.
+// CHECK3: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
+//.
+// CHECK4: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
+//.
 // CHECK1-LABEL: define {{[^@]+}}@main
 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
 // CHECK1-NEXT:  

[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-05-22 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D141907#4355229 , @paperchalice 
wrote:

> In D141907#4355228 , @tstellar 
> wrote:
>
>> @paperchalice Do you need someone to commit this for you?
>
> Sure, I don't have the commit access.

What name / email address do you want me to use for the commit author field?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-05-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@paperchalice Do you need someone to commit this for you?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D150723: clang/openmp: Fix alignment for ThreadID Address variables

2023-05-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 522853.
tstellar added a comment.

Add test case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150723

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp
  clang/test/OpenMP/for_reduction_codegen.cpp


Index: clang/test/OpenMP/for_reduction_codegen.cpp
===
--- clang/test/OpenMP/for_reduction_codegen.cpp
+++ clang/test/OpenMP/for_reduction_codegen.cpp
@@ -1,4 +1,4 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 
UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex 
"__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" 
"pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 
UTC_ARGS: --function-signature --check-globals --include-generated-funcs 
--replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" 
"reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _ 
--global-value-regex ".gomp_critical_user[a-zA-Z_.]+"
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 
-emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s 
--check-prefix=CHECK1
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 
-emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 
-include-pch %t -verify %s -emit-llvm -o - | FileCheck 
-allow-deprecated-dag-overlap %s --check-prefix=CHECK1
@@ -527,6 +527,14 @@
 
 
 #endif
+//.
+// CHECK1: @.gomp_critical_user_.reduction.var = common global [8 x i32] 
zeroinitializer, align 8
+// CHECK1: @.gomp_critical_user_.atomic_reduction.var = common global [8 x 
i32] zeroinitializer, align 8
+//.
+// CHECK3: @.gomp_critical_user_.reduction.var = common global [8 x i32] 
zeroinitializer, align 8
+//.
+// CHECK4: @.gomp_critical_user_.reduction.var = common global [8 x i32] 
zeroinitializer, align 8
+//.
 // CHECK1-LABEL: define {{[^@]+}}@main
 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
 // CHECK1-NEXT:  entry:
Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp
===
--- clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -2143,7 +2143,11 @@
 llvm::Value *CGOpenMPRuntime::getCriticalRegionLock(StringRef CriticalName) {
   std::string Prefix = Twine("gomp_critical_user_", CriticalName).str();
   std::string Name = getName({Prefix, "var"});
-  return OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::GlobalVariable *G = 
OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::Align PtrAlign = 
OMPBuilder.M.getDataLayout().getPointerABIAlignment(G->getAddressSpace());
+  if (PtrAlign > llvm::Align(G->getAlignment()))
+G->setAlignment(PtrAlign);
+  return G;
 }
 
 namespace {


Index: clang/test/OpenMP/for_reduction_codegen.cpp
===
--- clang/test/OpenMP/for_reduction_codegen.cpp
+++ clang/test/OpenMP/for_reduction_codegen.cpp
@@ -1,4 +1,4 @@
-// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-globals --include-generated-funcs --replace-value-regex "__omp_offloading_[0-9a-z]+_[0-9a-z]+" "reduction_size[.].+[.]" "pl_cond[.].+[.|,]" --prefix-filecheck-ir-name _ --global-value-regex ".gomp_critical_user[a-zA-Z_.]+"
 // RUN: %clang_cc1 -verify -fopenmp -x c++ -triple x86_64-apple-darwin10 -emit-llvm %s -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
 // RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -triple x86_64-apple-darwin10 -emit-pch -o %t %s
 // RUN: %clang_cc1 -fopenmp -x c++ -triple x86_64-apple-darwin10 -std=c++11 -include-pch %t -verify %s -emit-llvm -o - | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=CHECK1
@@ -527,6 +527,14 @@
 
 
 #endif
+//.
+// CHECK1: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
+// CHECK1: @.gomp_critical_user_.atomic_reduction.var = common global [8 x i32] zeroinitializer, align 8
+//.
+// CHECK3: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
+//.
+// CHECK4: @.gomp_critical_user_.reduction.var = common global [8 x i32] zeroinitializer, align 8
+//.
 // CHECK1-LABEL: define {{[^@]+}}@main
 // CHECK1-SAME: () #[[ATTR0:[0-9]+]] {
 // CHECK1-NEXT:  entry:
Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp
===
--- clang/lib/CodeGen/CGOpenMPRuntime.cpp

[PATCH] D150723: clang/openmp: Fix alignment for ThreadID Address variables

2023-05-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added a reviewer: jlpeyton.
Herald added subscribers: sunshaoce, guansong, yaxunl.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, jplehr, sstefan1.
Herald added a project: clang.

There are places in the runtime, like __kmp_init_indirect_csptr, which
assume these pointers are aligned to sizeof(void*), so make sure we emit
them with the correct alignment.

Fixes #62668


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D150723

Files:
  clang/lib/CodeGen/CGOpenMPRuntime.cpp


Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp
===
--- clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -2143,7 +2143,11 @@
 llvm::Value *CGOpenMPRuntime::getCriticalRegionLock(StringRef CriticalName) {
   std::string Prefix = Twine("gomp_critical_user_", CriticalName).str();
   std::string Name = getName({Prefix, "var"});
-  return OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::GlobalVariable *G = 
OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::Align PtrAlign = 
OMPBuilder.M.getDataLayout().getPointerABIAlignment(G->getAddressSpace());
+  if (PtrAlign > llvm::Align(G->getAlignment()))
+G->setAlignment(PtrAlign);
+  return G;
 }
 
 namespace {


Index: clang/lib/CodeGen/CGOpenMPRuntime.cpp
===
--- clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -2143,7 +2143,11 @@
 llvm::Value *CGOpenMPRuntime::getCriticalRegionLock(StringRef CriticalName) {
   std::string Prefix = Twine("gomp_critical_user_", CriticalName).str();
   std::string Name = getName({Prefix, "var"});
-  return OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::GlobalVariable *G = OMPBuilder.getOrCreateInternalVariable(KmpCriticalNameTy, Name);
+  llvm::Align PtrAlign = OMPBuilder.M.getDataLayout().getPointerABIAlignment(G->getAddressSpace());
+  if (PtrAlign > llvm::Align(G->getAlignment()))
+G->setAlignment(PtrAlign);
+  return G;
 }
 
 namespace {
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D149809: [Clang][Docs] Fix man page build

2023-05-11 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149809

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


[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-05-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

Thanks for the patch.  I've tested this and it works for my build 
configuration.  LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-05-05 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: cmake/Modules/GetClangResourceDir.cmake:13
+  if(DEFINED CLANG_RESOURCE_DIR AND NOT CLANG_RESOURCE_DIR STREQUAL "")
+set(ret_dir bin/${CLANG_RESOURCE_DIR})
+  else()

tstellar wrote:
> tstellar wrote:
> > paperchalice wrote:
> > > tstellar wrote:
> > > > Why is the bin prefix here?
> > > See 
> > > https://clang.llvm.org/doxygen/classclang_1_1driver_1_1Driver.html#acda8dfdf4f80efa84df98157e1779152
> > > `GetResourcesPath` will return `/lib/` when 
> > > `CLANG_RESOURCE_DIR` is empty, `/bin/CLANG_RESOURCE_DIR` 
> > > otherwise.
> > > 
> > `GetResourcesPath` calls `sys::path::parent_path` twice on the path to the 
> > clang executable which is going to give you `/usr ` on most Linux systems, 
> > so it's returning `/CLANG_RESOURCE_DIR` not 
> > `/bin/CLANG_RESOURCE_DIR`.
> Sorry, you are correct.  I was looking at the wrong branch.  It's really 
> strange that it does that.
@paperchalice Can you update the description of the CLANG_RESOURCE_DIR cache 
variable in clang/CMakeLists.txt to mention that the path should be relative to 
the directory with the clang executable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-05-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: cmake/Modules/GetClangResourceDir.cmake:13
+  if(DEFINED CLANG_RESOURCE_DIR AND NOT CLANG_RESOURCE_DIR STREQUAL "")
+set(ret_dir bin/${CLANG_RESOURCE_DIR})
+  else()

tstellar wrote:
> paperchalice wrote:
> > tstellar wrote:
> > > Why is the bin prefix here?
> > See 
> > https://clang.llvm.org/doxygen/classclang_1_1driver_1_1Driver.html#acda8dfdf4f80efa84df98157e1779152
> > `GetResourcesPath` will return `/lib/` when 
> > `CLANG_RESOURCE_DIR` is empty, `/bin/CLANG_RESOURCE_DIR` otherwise.
> > 
> `GetResourcesPath` calls `sys::path::parent_path` twice on the path to the 
> clang executable which is going to give you `/usr ` on most Linux systems, so 
> it's returning `/CLANG_RESOURCE_DIR` not 
> `/bin/CLANG_RESOURCE_DIR`.
Sorry, you are correct.  I was looking at the wrong branch.  It's really 
strange that it does that.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-05-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: cmake/Modules/GetClangResourceDir.cmake:13
+  if(DEFINED CLANG_RESOURCE_DIR AND NOT CLANG_RESOURCE_DIR STREQUAL "")
+set(ret_dir bin/${CLANG_RESOURCE_DIR})
+  else()

paperchalice wrote:
> tstellar wrote:
> > Why is the bin prefix here?
> See 
> https://clang.llvm.org/doxygen/classclang_1_1driver_1_1Driver.html#acda8dfdf4f80efa84df98157e1779152
> `GetResourcesPath` will return `/lib/` when 
> `CLANG_RESOURCE_DIR` is empty, `/bin/CLANG_RESOURCE_DIR` otherwise.
> 
`GetResourcesPath` calls `sys::path::parent_path` twice on the path to the 
clang executable which is going to give you `/usr ` on most Linux systems, so 
it's returning `/CLANG_RESOURCE_DIR` not 
`/bin/CLANG_RESOURCE_DIR`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D141907: [CMake] Ensure `CLANG_RESOURCE_DIR` is respected

2023-05-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.
Herald added subscribers: ekilmer, jplehr.



Comment at: cmake/Modules/GetClangResourceDir.cmake:13
+  if(DEFINED CLANG_RESOURCE_DIR AND NOT CLANG_RESOURCE_DIR STREQUAL "")
+set(ret_dir bin/${CLANG_RESOURCE_DIR})
+  else()

Why is the bin prefix here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141907

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


[PATCH] D149809: [Clang][Docs] Fix man page build

2023-05-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D149809#4317763 , @aidengrossman 
wrote:

> In D149809#4317610 , @tstellar 
> wrote:
>
>> I think we could remove some of the duplication by making the docs_target 
>> parameter into a list and passing both docs-clang-html and docs-clang-man to 
>> it.
>
> If I'm understanding things correctly we wouldn't be able to do this for 
> either the `gen_docs_depends` or `gen_rst_file_from_td` functions because 
> someone might have the HTML docs build turned on and the man pages build 
> turned off or vice versa. We can only add dependencies to the target after 
> it's created as far as I'm aware.

I tried to explain what I was thinking with the suggested edits.  Does that 
make sense?




Comment at: clang/docs/CMakeLists.txt:93
 
-function (gen_rst_file_from_td output_file td_option source docs_target)
+function (gen_rst_file_from_td output_file td_option source)
   if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${source}")





Comment at: clang/docs/CMakeLists.txt:99
   list(APPEND LLVM_TABLEGEN_FLAGS "-I${TABLEGEN_INCLUDE_DIR}")
   clang_tablegen(${output_file} ${td_option} SOURCE ${source} TARGET 
"gen-${output_file}")
+endfunction()





Comment at: clang/docs/CMakeLists.txt:112
   include(AddSphinxTarget)
-  if (SPHINX_FOUND)
+  if (SPHINX_FOUND AND (${SPHINX_OUTPUT_HTML} OR ${SPHINX_OUTPUT_MAN}))
+# Copy rst files to build directory before generating the html





Comment at: clang/docs/CMakeLists.txt:128-131
+# Generated files
+gen_rst_file_from_td(AttributeReference.rst -gen-attr-docs 
../include/clang/Basic/Attr.td)
+gen_rst_file_from_td(DiagnosticsReference.rst -gen-diag-docs 
../include/clang/Basic/Diagnostic.td)
+gen_rst_file_from_td(ClangCommandLineReference.rst -gen-opt-docs 
../include/clang/Driver/ClangOptionDocs.td)





Comment at: clang/docs/CMakeLists.txt:134
 if (${SPHINX_OUTPUT_HTML})
   add_sphinx_target(html clang SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
 





Comment at: clang/docs/CMakeLists.txt:144
 if (${SPHINX_OUTPUT_MAN})
-  add_sphinx_target(man clang)
+  add_sphinx_target(man clang SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+  gen_docs_depends(docs-clang-man)




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149809

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


[PATCH] D149809: [Clang][Docs] Fix man page build

2023-05-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I think we could remove some of the duplication by making the docs_target 
parameter into a list and passing both docs-clang-html and docs-clang-man to it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D149809

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


[PATCH] D109693: Driver: Remove major release version detection for RHEL

2023-03-31 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 509912.
tstellar added a comment.
Herald added a subscriber: MaskRay.
Herald added a project: All.

Rebase and fix formatting.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109693

Files:
  clang/include/clang/Driver/Distro.h
  clang/lib/Driver/Distro.cpp
  clang/unittests/Driver/DistroTest.cpp


Index: clang/unittests/Driver/DistroTest.cpp
===
--- clang/unittests/Driver/DistroTest.cpp
+++ clang/unittests/Driver/DistroTest.cpp
@@ -152,7 +152,7 @@

"REDHAT_SUPPORT_PRODUCT_VERSION=\"7\"\n"));
 
   Distro CentOS7{CentOS7FileSystem, llvm::Triple("unknown-pc-linux")};
-  ASSERT_EQ(Distro(Distro::RHEL7), CentOS7);
+  ASSERT_EQ(Distro(Distro::RHEL), CentOS7);
   ASSERT_FALSE(CentOS7.IsUbuntu());
   ASSERT_TRUE(CentOS7.IsRedhat());
   ASSERT_FALSE(CentOS7.IsOpenSUSE());
Index: clang/lib/Driver/Distro.cpp
===
--- clang/lib/Driver/Distro.cpp
+++ clang/lib/Driver/Distro.cpp
@@ -121,12 +121,7 @@
   return Distro::Fedora;
 if (Data.startswith("Red Hat Enterprise Linux") ||
 Data.startswith("CentOS") || Data.startswith("Scientific Linux")) {
-  if (Data.contains("release 7"))
-return Distro::RHEL7;
-  else if (Data.contains("release 6"))
-return Distro::RHEL6;
-  else if (Data.contains("release 5"))
-return Distro::RHEL5;
+  return Distro::RHEL;
 }
 return Distro::UnknownDistro;
   }
Index: clang/include/clang/Driver/Distro.h
===
--- clang/include/clang/Driver/Distro.h
+++ clang/include/clang/Driver/Distro.h
@@ -40,9 +40,7 @@
 DebianBookworm,
 DebianTrixie,
 Exherbo,
-RHEL5,
-RHEL6,
-RHEL7,
+RHEL,
 Fedora,
 Gentoo,
 OpenSUSE,
@@ -117,9 +115,7 @@
   /// @name Convenience Predicates
   /// @{
 
-  bool IsRedhat() const {
-return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
-  }
+  bool IsRedhat() const { return DistroVal == Fedora || DistroVal == RHEL; }
 
   bool IsOpenSUSE() const { return DistroVal == OpenSUSE; }
 


Index: clang/unittests/Driver/DistroTest.cpp
===
--- clang/unittests/Driver/DistroTest.cpp
+++ clang/unittests/Driver/DistroTest.cpp
@@ -152,7 +152,7 @@
"REDHAT_SUPPORT_PRODUCT_VERSION=\"7\"\n"));
 
   Distro CentOS7{CentOS7FileSystem, llvm::Triple("unknown-pc-linux")};
-  ASSERT_EQ(Distro(Distro::RHEL7), CentOS7);
+  ASSERT_EQ(Distro(Distro::RHEL), CentOS7);
   ASSERT_FALSE(CentOS7.IsUbuntu());
   ASSERT_TRUE(CentOS7.IsRedhat());
   ASSERT_FALSE(CentOS7.IsOpenSUSE());
Index: clang/lib/Driver/Distro.cpp
===
--- clang/lib/Driver/Distro.cpp
+++ clang/lib/Driver/Distro.cpp
@@ -121,12 +121,7 @@
   return Distro::Fedora;
 if (Data.startswith("Red Hat Enterprise Linux") ||
 Data.startswith("CentOS") || Data.startswith("Scientific Linux")) {
-  if (Data.contains("release 7"))
-return Distro::RHEL7;
-  else if (Data.contains("release 6"))
-return Distro::RHEL6;
-  else if (Data.contains("release 5"))
-return Distro::RHEL5;
+  return Distro::RHEL;
 }
 return Distro::UnknownDistro;
   }
Index: clang/include/clang/Driver/Distro.h
===
--- clang/include/clang/Driver/Distro.h
+++ clang/include/clang/Driver/Distro.h
@@ -40,9 +40,7 @@
 DebianBookworm,
 DebianTrixie,
 Exherbo,
-RHEL5,
-RHEL6,
-RHEL7,
+RHEL,
 Fedora,
 Gentoo,
 OpenSUSE,
@@ -117,9 +115,7 @@
   /// @name Convenience Predicates
   /// @{
 
-  bool IsRedhat() const {
-return DistroVal == Fedora || (DistroVal >= RHEL5 && DistroVal <= RHEL7);
-  }
+  bool IsRedhat() const { return DistroVal == Fedora || DistroVal == RHEL; }
 
   bool IsOpenSUSE() const { return DistroVal == OpenSUSE; }
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138472: clang/cmake: Use installed gtest libraries for stand-alone builds

2023-03-10 Thread Tom Stellard via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG821691039585: clang/cmake: Use installed gtest libraries for 
stand-alone builds (authored by tstellar).

Changed prior to commit:
  https://reviews.llvm.org/D138472?vs=477058=504328#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138472

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -118,12 +118,10 @@
 set(LLVM_UTILS_PROVIDED ON)
 set(CLANG_TEST_DEPS FileCheck count not)
   endif()
-  set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-  AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} third-party/unittest)
-  endif()
+endif()
+
+if (NOT TARGET llvm_gtest)
+message(FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest 
or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
 endif()
 
 if(LLVM_LIT)
@@ -506,13 +504,11 @@
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
-add_subdirectory(unittests)
-list(APPEND CLANG_TEST_DEPS ClangUnitTests)
-list(APPEND CLANG_TEST_PARAMS
-  clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
-  )
-  endif()
+  add_subdirectory(unittests)
+  list(APPEND CLANG_TEST_DEPS ClangUnitTests)
+  list(APPEND CLANG_TEST_PARAMS
+clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
+  )
   add_subdirectory(test)
   add_subdirectory(bindings/python/tests)
 


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -118,12 +118,10 @@
 set(LLVM_UTILS_PROVIDED ON)
 set(CLANG_TEST_DEPS FileCheck count not)
   endif()
-  set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-  AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} third-party/unittest)
-  endif()
+endif()
+
+if (NOT TARGET llvm_gtest)
+message(FATAL_ERROR "llvm-gtest not found. Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
 endif()
 
 if(LLVM_LIT)
@@ -506,13 +504,11 @@
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
-add_subdirectory(unittests)
-list(APPEND CLANG_TEST_DEPS ClangUnitTests)
-list(APPEND CLANG_TEST_PARAMS
-  clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
-  )
-  endif()
+  add_subdirectory(unittests)
+  list(APPEND CLANG_TEST_DEPS ClangUnitTests)
+  list(APPEND CLANG_TEST_PARAMS
+clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
+  )
   add_subdirectory(test)
   add_subdirectory(bindings/python/tests)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D143306: [Driver] Default to -fno-openmp-implicit-rpath

2023-03-09 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Should we apply this patch to the release/16.x branch to create a more smooth 
transition since the option has been removed in main?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143306

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


[PATCH] D142174: [OpenMP] Don't set rpath for system paths

2023-03-09 Thread Tom Stellard via Phabricator via cfe-commits
tstellar abandoned this revision.
tstellar added a comment.

-fopenmp-add-rpath has been removed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142174

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


[PATCH] D145704: Revert "Set FLT_EVAL_METHOD to -1 when fast-math is enabled."

2023-03-09 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

We're holding -rc4 until this is merged, so it would be great if we could merge 
it on Friday.


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

https://reviews.llvm.org/D145704

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


[PATCH] D118493: Set rpath on openmp executables

2023-03-09 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D118493#4182583 , @JonChesterfield 
wrote:

> Duplicating a comment from the commit thread so it's easier for me to find 
> later.
>
> You've applied this to the release branches going back as far as 14. It's a 
> user facing breaking change. As in people who have a working openmp toolchain 
> and update to the point release which looks like a semantic versioning thing 
> indicating minor bugfixes will experience immediate cessation of function. I 
> consider that very poor user experience and do not agree with the scope of 
> breakage.

I don't see this revert  in any of the official release branches.  Am I missing 
something?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118493

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


[PATCH] D144853: [Clang][RISCV] Add CMake options to configure default CPU

2023-02-27 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Would this make more sense in a config file rather than a CMake option?  
@MaskRay


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144853

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


[PATCH] D143306: [Driver] Default to -fno-openmp-implicit-rpath

2023-02-22 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@JonChesterfield I don't think we should be putting any Fedora specific logic 
into clang's build system or the driver, if that's what you are suggesting.  
Fedora can always patch the compiler or install a config file to change the 
default behavior, even though this is something we try really hard to avoid.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143306

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


[PATCH] D143306: [Driver] Default to -fno-openmp-implicit-rpath

2023-02-22 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D143306#4145432 , @MaskRay wrote:

> This is the point. Specifying a driver option to use 
> libc++/libc++abi/libunwind doesn't magically change `DT_RUNPATH`. This is 
> exactly the behavior a user wants for a system Clang.
> It does make users with a non-system Clang inconvenient but that's the point 
> that such users should specify rpath by themselves.
> openmp should not diverge from libc++/libc++abi/libunwind in this regard.

To me this is a really strong argument in favor of this change.  Why does 
libomp need to be different here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143306

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


[PATCH] D143306: [Driver] Default to -fno-openmp-implicit-rpath

2023-02-21 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D143306#4142023 , @JonChesterfield 
wrote:

> I don't mind hugely what mechanism is used but would really like clang++ 
> -fopenmp foo.cpp to build a program that runs. How can we preserve that 
> 'works' feature without setting rpath on the binary?

This is just for  running clang from the build directory, right? I think 
@MaskRay suggested using a config file before.  Maybe we can put a config file 
in $build/bin/ which makes this work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143306

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


[PATCH] D143306: [Driver] Default to -fno-openmp-implicit-rpath

2023-02-21 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

FWIW, I'm in favor of this patch.  System directory rpaths (e.g. /usr/lib64) 
are not allowed in Fedora Linux.  The current default makes building packages 
with clang+openmp more difficult.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143306

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


[PATCH] D143348: [Clang][Doc][OpenCL] Release 16 notes

2023-02-06 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM.


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

https://reviews.llvm.org/D143348

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


[PATCH] D142606: Lazyly initialize uncommon toolchain detector

2023-01-26 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D142606#4082783 , 
@serge-sans-paille wrote:

> In D142606#4082753 , @tstellar 
> wrote:
>
>> Does this mean that clang will no longer search for the ROCM and CUDA 
>> library paths for every C compile?
>
> That's the goal, yes.

That's great!  Thanks for working on this.  I think this looks OK, but someone 
with more C++ knowledge than me should probably look over the LazyDetector 
class implementation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142606

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


[PATCH] D142606: Lazyly initialize uncommon toolchain detector

2023-01-26 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Does this mean that clang will no longer search for the ROCM and CUDA library 
paths for every C compile?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142606

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


[PATCH] D142511: [clang][test] Remove check that fails if SOURCE_DATE_EPOCH is set globally

2023-01-24 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM. Thank you.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142511

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


[PATCH] D131632: [clang] Enable output of SARIF diagnostics

2023-01-24 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/test/Frontend/sarif-diagnostics.cpp:8
+// Omit filepath to llvm project directory
+// CHECK: 
clang/test/Frontend/sarif-diagnostics.cpp"},"mimeType":"text/plain","roles":["resultFile"]}],"columnKind":"unicodeCodePoints","results":[{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":1,"startColumn":1,"startLine":12}}}],"message":{"text":"'main'
 must return 
'int'"},"ruleId":"3465","ruleIndex":0},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":11,"startColumn":11,"startLine":13}}}],"message":{"text":"use
 of undeclared identifier 
'hello'"},"ruleId":"4604","ruleIndex":1},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":17,"startColumn":17,"startLine":15}}}],"message":{"text":"invalid
 digit 'a' in decimal 
constant"},"ruleId":"898","ruleIndex":2},{"level":"warning","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":5,"startColumn":5,"startLine":19}}}],"message":{"text":"misleading
 indentation; statement is not part of the previous 
'if'"},"ruleId":"1806","ruleIndex":3},{"level":"note","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":3,"startColumn":3,"startLine":17}}}],"message":{"text":"previous
 statement is 
here"},"ruleId":"1730","ruleIndex":4},{"level":"warning","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":10,"startColumn":10,"startLine":18}}}],"message":{"text":"unused
 variable 
'Yes'"},"ruleId":"6539","ruleIndex":5},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":12,"startColumn":12,"startLine":21}}}],"message":{"text":"use
 of undeclared identifier 
'hi'"},"ruleId":"4604","ruleIndex":6},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":1,"startColumn":1,"startLine":23}}}],"message":{"text":"extraneous
 closing brace 
('}')"},"ruleId":"1399","ruleIndex":7},{"level":"error","locations":[{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":6,"endLine":27,"startColumn":5,"startLine":27}}},{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":10,"endLine":27,"startColumn":9,"startLine":27}}},{"physicalLocation":{"artifactLocation":{"index":0},"region":{"endColumn":7,"startColumn":7,"startLine":27}}}],"message":{"text":"invalid
 operands to binary expression ('t1' and 
't1')"},"ruleId":"4539","ruleIndex":8}],"tool":{"driver":{"fullName":"","informationUri":"https://clang.llvm.org/docs/UsersManual.html","language":"en-US","name":"clang","rules":[{"defaultConfiguration":{"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"3465","name":""},{"defaultConfiguration":{"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"4604","name":""},{"defaultConfiguration":{"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"898","name":""},{"defaultConfiguration":{"enabled":true,"level":"warning","rank":-1},"fullDescription":{"text":""},"id":"1806","name":""},{"defaultConfiguration":{"enabled":true,"level":"note","rank":-1},"fullDescription":{"text":""},"id":"1730","name":""},{"defaultConfiguration":{"enabled":true,"level":"warning","rank":-1},"fullDescription":{"text":""},"id":"6539","name":""},{"defaultConfiguration":{"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"4604","name":""},{"defaultConfiguration":{"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"1399","name":""},{"defaultConfiguration":{"enabled":true,"level":"error","rank":50},"fullDescription":{"text":""},"id":"4539","name":""}],"version":"16.0.0"}}}],"version":"2.1.0"}
+// CHECK: 2 warnings and 6 errors generated.

aaron.ballman wrote:
> uabelho wrote:
> > dyung wrote:
> > > dyung wrote:
> > > > Can this CHECK line be broken into smaller pieces? This test is failing 
> > > > on our internal bot, and I'm going crosseyed trying to figure out what 
> > > > the difference is because the line is 3741 characters long!
> > > Is there any significance to the "ruleId" and "Id" values in this test? 
> > > If not, can we just use a regex to check for a number? Our internal build 
> > > with private changes is failing due to slightly different numbers in some 
> > > of the "ruleId" fields
> > +1 on this. We also get different "ruleId" and "Id" values downstream and 
> > it's quite painful trying to figure out where the diffs are in a +3700 
> > character CHECK.
> I ran into this problem this morning as well. I've improved the situation 
> somewhat in b345be177d03166add391f090fd0288a23413934, but I think we really 
> could use some better diff tooling than FileCheck for diffing between two 
> JSON files.
> 
> The test can still be 

[PATCH] D136717: [clang] Move getenv call for SOURCE_DATE_EPOCH out of frontend NFC

2023-01-24 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/test/Driver/SOURCE_DATE_EPOCH.c:2
+// RUN: %clang -E %s -### 2>&1 | FileCheck %s -check-prefix=NO_EPOCH
+// NO_EPOCH-NOT: "-source-date-epoch"
+

Hi @benlangmuir, this test fails in our build environment, because we have the 
SOURCE_DATE_EPOCH env variable set globally.  Is there any way to update the 
test to handle this scenario?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136717

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


[PATCH] D142199: [Docs] Replace recommonmark with myst-parser

2023-01-24 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a subscriber: gkistanova.
tstellar added a comment.

@luke You'll need to contact the bot owners so they can update machine.  The 
workers running the publish-sphinx-docs will need to be updated too.  
@gkistanova should be able to help.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142199

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


[PATCH] D142403: [build] Fix stand-alone builds of clang.

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM.  I tested and this fixes the build.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142403

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


[PATCH] D142403: [build] Force building LLVMTargetParser before other non-LLVM components.

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D142403#4074905 , @fpetrogalli 
wrote:

> In D142403#4074885 , @tstellar 
> wrote:
>
>> This is still the wrong change IMO.  I don't know, maybe I'm not being 
>> clear, but I don't 'think you ever actually tried my suggestion in D141581 
>>  which was to leave  the 
>> RISCVTargetParserTableGen Depends as is and add the pseudo targets in 
>> llvm/cmake/modules/LLVMConfig.cmake.in.
>
> We'll get there! I think I missed the "leave the `RISCVTargetParserTableGen` 
> in the `DEPENDS`, sorry about that.

No problem!  Thanks for sticking with it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142403

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


[PATCH] D142403: [build] Force building LLVMTargetParser before other non-LLVM components.

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

This is still the wrong change IMO.  I don't know, maybe I'm not being clear, 
but I don't 'think you ever actually tried my suggestion in D141581 
 which was to leave  the 
RISCVTargetParserTableGen Depends as is and add the pseudo targets in 
llvm/cmake/modules/LLVMConfig.cmake.in.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142403

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


[PATCH] D141581: [build] Fix stand-alone builds of clang.

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@fpetrogalli The solution is to add   RISCVTargetParserTableGen to the Depnds 
list of clang/lib/Driver and clang/lib/Basic.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D141581: [build] Fix stand-alone builds of clang.

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@fpetrogalli Please go ahead and push this since it is blocking others, we can 
fix up any of the other issues later.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D141581: [build] Fix stand-alone builds of clang.

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

I tested this patch and it works, so I'll give it an LGTM.  However, I think  
the LLVMConfig.cmake.in changes are now unnecessary since the 
RISCVTargetParserTableGen has been dropped from all clang targets.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D141581: [build] Fix stand-alone builds of clang.

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/lib/Basic/CMakeLists.txt:113
   omp_gen
-  RISCVTargetParserTableGen
   )

Doesn't this break the monorepo (non-standalone) build?  If the  monorepo build 
still works with this, then you don't need the changes to 
llvm/cmake/modules/LLVMConfig.cmake.in


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D142199: [Docs] Replace recommonmark with myst-parser

2023-01-23 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

LGTM.  Can you add something to the release notes about this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142199

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


[PATCH] D141581: [clang] Make clangBasic and clangDriver depend on LLVMTargetParser.

2023-01-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I spent some time looking at this.  Rather than changing the dependency from 
RISCVTargetParserTableGen to LLVMTargetParser, I think the correct fix is to 
handle RISCVTargetParserTableGen in llvm/cmake/modules/LLVMConfig.cmake.in.  
alongside the intrinsics_gen, omp_gen, and acc_gen targets.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D141581: [clang] Make clangBasic and clangDriver depend on LLVMTargetParser.

2023-01-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I don't think this is the correct way to specify dependencies if it's just an 
issue of the header being included before a generated file it needs has been 
generated.  Are there other places in the code where a generated header file is 
included by another header?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D141581: [clang] Make clangBasic and clangDriver depend on LLVMTargetParser.

2023-01-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

So, what's the actual dependency here?  Do libBasic and libDriver just need the 
header to be generated or does it actually need to link to the library?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D141581: [clang] Make clangBasic and clangDriver depend on LLVMTargetParser.

2023-01-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

Is LLVMTargetParser a library

In D141581#4057177 , @fpetrogalli 
wrote:

> In D141581#4056825 , @barannikov88 
> wrote:
>
>> clangBasic and clangDriver already have a dependency on TargetParser (see 
>> LLVM_LINK_COMPONENTS at the beginning of corresponding files). Is that not 
>> enough?
>> Will it build if you just remove the additional dependency?
>
> No - if we just specify the dependency in `LLVM_LINK_COMPONENTS`, there are 
> build failures, as explained in the commit message of 
> https://reviews.llvm.org/rGac1ffd3caca12c254e0b8c847aa8ce8e51b6cfbf.

It's still not clear to me why LLVM_LINK_COMPONENTS does not work.  Is 
LLVMTargetParser a library?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141581

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


[PATCH] D142199: [Docs] Replace recommonmark with myst-parser

2023-01-20 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.
Herald added a subscriber: asb.



Comment at: flang/docs/ComplexOperations.md:37
 **FIR**
-```c
 func.func @_QPpow_self(%arg0: !fir.ref>) -> !fir.complex<4> {

Do these changes have any affected on the output html?  Is there another way to 
specify the language?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142199

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


[PATCH] D142174: [OpenMP] Don't set rpath for system paths

2023-01-19 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:799
+.Default(false);
+}
+

I wasn't sure exactly how to determine if something is a system path, so I'm 
open to other ideas here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142174

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


[PATCH] D142174: [OpenMP] Don't set rpath for system paths

2023-01-19 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: JonChesterfield, MaskRay.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

Suggested in https://reviews.llvm.org/D118493#3402001


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142174

Files:
  clang/lib/Driver/ToolChains/CommonArgs.cpp


Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -791,6 +791,13 @@
  /*IsLTO=*/true, PluginOptPrefix);
 }
 
+static bool isSystemPath(const StringRef ) {
+  return llvm::StringSwitch(path)
+.Case("/usr/lib", true)
+.Case("/usr/lib64", true)
+.Default(false);
+}
+
 void tools::addOpenMPRuntimeSpecificRPath(const ToolChain ,
   const ArgList ,
   ArgStringList ) {
@@ -802,6 +809,11 @@
 SmallString<256> DefaultLibPath =
 llvm::sys::path::parent_path(TC.getDriver().Dir);
 llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME);
+
+// If clang is installed to a 'system path' there is no reason to add 
rpath.
+if (isSystemPath(DefaultLibPath))
+  return;
+
 CmdArgs.push_back("-rpath");
 CmdArgs.push_back(Args.MakeArgString(DefaultLibPath));
   }


Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -791,6 +791,13 @@
  /*IsLTO=*/true, PluginOptPrefix);
 }
 
+static bool isSystemPath(const StringRef ) {
+  return llvm::StringSwitch(path)
+.Case("/usr/lib", true)
+.Case("/usr/lib64", true)
+.Default(false);
+}
+
 void tools::addOpenMPRuntimeSpecificRPath(const ToolChain ,
   const ArgList ,
   ArgStringList ) {
@@ -802,6 +809,11 @@
 SmallString<256> DefaultLibPath =
 llvm::sys::path::parent_path(TC.getDriver().Dir);
 llvm::sys::path::append(DefaultLibPath, CLANG_INSTALL_LIBDIR_BASENAME);
+
+// If clang is installed to a 'system path' there is no reason to add rpath.
+if (isSystemPath(DefaultLibPath))
+  return;
+
 CmdArgs.push_back("-rpath");
 CmdArgs.push_back(Args.MakeArgString(DefaultLibPath));
   }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138472: clang/cmake: Use installed gtest libraries for stand-alone builds

2022-11-22 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/CMakeLists.txt:103
 if (LLVM_LIT AND LLVM_UTILS_PROVIDED)
-  set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
- AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} third-part/unittest)
+  find_package(LLVMGTest)
+  if (NOT TARGET llvm_gtest)

kwk wrote:
> I don't see no `FindLLVMGTest.cmake` file anywhere. Is that suppose to exist 
> yet or which Patch is suppose to create it?
It's added in  D137890.  And it's called LLVMGTestConfig.cmake.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138472

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


[PATCH] D138472: clang/cmake: Use installed gtest libraries for stand-alone builds

2022-11-21 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: mgorny, phosek, Ericson2314.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138472

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -100,11 +100,9 @@
  DOC "Path to lit.py")
 
 if (LLVM_LIT AND LLVM_UTILS_PROVIDED)
-  set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
- AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} third-part/unittest)
+  find_package(LLVMGTest)
+  if (NOT TARGET llvm_gtest)
+ message(FATAL_ERROR "llvm-gtest not found.  Please install llvm-gtest 
or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
   endif()
 
   # Define the default arguments to use with 'lit', and an option for the 
user
@@ -519,13 +517,11 @@
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
-add_subdirectory(unittests)
-list(APPEND CLANG_TEST_DEPS ClangUnitTests)
-list(APPEND CLANG_TEST_PARAMS
-  clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
-  )
-  endif()
+  add_subdirectory(unittests)
+  list(APPEND CLANG_TEST_DEPS ClangUnitTests)
+  list(APPEND CLANG_TEST_PARAMS
+clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
+  )
   add_subdirectory(test)
   add_subdirectory(bindings/python/tests)
 


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -100,11 +100,9 @@
  DOC "Path to lit.py")
 
 if (LLVM_LIT AND LLVM_UTILS_PROVIDED)
-  set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
- AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} third-part/unittest)
+  find_package(LLVMGTest)
+  if (NOT TARGET llvm_gtest)
+ message(FATAL_ERROR "llvm-gtest not found.  Please install llvm-gtest or disable tests with -DLLVM_INCLUDE_TESTS=OFF")
   endif()
 
   # Define the default arguments to use with 'lit', and an option for the user
@@ -519,13 +517,11 @@
 
 
 if( CLANG_INCLUDE_TESTS )
-  if(EXISTS ${LLVM_THIRD_PARTY_DIR}/unittest/googletest/include/gtest/gtest.h)
-add_subdirectory(unittests)
-list(APPEND CLANG_TEST_DEPS ClangUnitTests)
-list(APPEND CLANG_TEST_PARAMS
-  clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
-  )
-  endif()
+  add_subdirectory(unittests)
+  list(APPEND CLANG_TEST_DEPS ClangUnitTests)
+  list(APPEND CLANG_TEST_PARAMS
+clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
+  )
   add_subdirectory(test)
   add_subdirectory(bindings/python/tests)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D138258: clang/cmake: Fix incorrectly disabling tests when LLVM_EXTERNAL_LIT is used

2022-11-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/CMakeLists.txt:97
 # Seek installed Lit.
-find_program(LLVM_LIT
- NAMES llvm-lit lit.py lit
- PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
- DOC "Path to lit.py")
+if (NOT LLVM_EXTERNAL_LIT)
+  find_program(LLVM_EXTERNAL_LIT

kwk wrote:
> mgorny wrote:
> > I don't think you need to do this if you rename the var, `find_program()` 
> > doesn't seem to do any searching when the var is already set.
> > 
> > I've tested with a dummy CMakeLists:
> > 
> > ```
> > set(FOO /bin/true)
> > find_program(FOO NAMES foo)
> > message(FATAL_ERROR ${FOO})
> > ```
> > 
> > gives `/bin/true` for me.
> > I don't think you need to do this if you rename the var, `find_program()` 
> > doesn't seem to do any searching when the var is already set.
> 
> This might be true but it is counter intuitive to assume that `find_program` 
> does nothing. So for readability I'd keep the `if (NOT LLVM_EXTERNAL_LIT)`. I 
> know it is not needed but with the `if` it won't look like 
> `find_program(LLVM_EXTERNAL_LIT` is the only/central place to set the 
> variable `LLVM_EXTERNAL_LIT`. With the guard around it, it becomes more 
> obvious that this is more of  a fallback.
@mgorny  The [[ http://devdoc.net/linux/cmake-3.9.6/command/find_program.html | 
documentation ]] confirms this too:

"Once one of the calls succeeds the result variable will be set and stored in 
the cache so that no call will search again."


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138258

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


[PATCH] D138258: clang/cmake: Fix incorrectly disabling tests when LLVM_EXTERNAL_LIT is used

2022-11-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D138258#3936260 , @kwk wrote:

> As much as I would like this to be fixed. I vote against this patch because 
> in `lld/CMakeLists.txt` there's an almost (if not entirely) identical piece 
> of code 
> 
>  that screams to be outsourced into a `/cmake/Modules/FindLit.cmake` (to be 
> created). I'll have a look at this and see if I can come up with a patch for 
> this. Afterall `/cmake` is the central place to distribute shared CMake code 
> between subprojects, right @phosek (didn't you create `/cmake` in the first 
> place)?

My eventual goal is to move this out into a separate CMake file, but I was 
hoping to simplify the code first before doing this.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138258

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


[PATCH] D138258: clang/cmake: Fix incorrectly disabling tests when LLVM_EXTERNAL_LIT is used

2022-11-17 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: mgorny, phosek, Ericson2314.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a project: clang.

This fixes a bug where tests would be disabled when LLVM_EXTERNAL_LIT
was set if lit couldn't be found in any of the standard search paths.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138258

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -94,10 +94,12 @@
 endif()
 
 # Seek installed Lit.
-find_program(LLVM_LIT
- NAMES llvm-lit lit.py lit
- PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
- DOC "Path to lit.py")
+if (NOT LLVM_EXTERNAL_LIT)
+  find_program(LLVM_EXTERNAL_LIT
+   NAMES llvm-lit lit.py lit
+   PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+   DOC "Path to lit.py")
+endif()
 
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   # Note: path not really used, except for checking if lit was found
@@ -119,7 +121,7 @@
   endif()
 endif()
 
-if(LLVM_LIT)
+if(LLVM_EXTERNAL_LIT)
   # Define the default arguments to use with 'lit', and an option for the 
user
   # to override.
   set(LIT_ARGS_DEFAULT "-sv")


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -94,10 +94,12 @@
 endif()
 
 # Seek installed Lit.
-find_program(LLVM_LIT
- NAMES llvm-lit lit.py lit
- PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
- DOC "Path to lit.py")
+if (NOT LLVM_EXTERNAL_LIT)
+  find_program(LLVM_EXTERNAL_LIT
+   NAMES llvm-lit lit.py lit
+   PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+   DOC "Path to lit.py")
+endif()
 
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   # Note: path not really used, except for checking if lit was found
@@ -119,7 +121,7 @@
   endif()
 endif()
 
-if(LLVM_LIT)
+if(LLVM_EXTERNAL_LIT)
   # Define the default arguments to use with 'lit', and an option for the user
   # to override.
   set(LIT_ARGS_DEFAULT "-sv")
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D137024: [compiler-rt] Switch from llvm-config to find_package(LLVM)

2022-11-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D137024#3931499 , @thetruestblue 
wrote:

> In D137024#3931497 , @tstellar 
> wrote:
>
>> @thetruestblue What paths besides LLVM_TOOLS_BINARY_DIR  do you need?
>
> TBD. 
> So far this seems like the only necessary path. But I am working to confirm 
> this.

Ok, I just looked at the code and I think all the variables that were set by 
llvm-config can also be set on the command line, so you should be able to 
specify everything manually to get it to work.  I'm curious where do you get 
your sources from?  Do you start with the full monorepo sources or do you use 
the compiler-rt standalone tarball?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137024

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


[PATCH] D137024: [compiler-rt] Switch from llvm-config to find_package(LLVM)

2022-11-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@thetruestblue What paths besides LLVM_TOOLS_BINARY_DIR  do you need?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137024

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


[PATCH] D137917: [cmake] Fix _GNU_SOURCE being added unconditionally

2022-11-14 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8da41fe69622: [cmake] Fix _GNU_SOURCE being added 
unconditionally (authored by Trass3r, committed by tstellar).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137917

Files:
  clang/CMakeLists.txt
  llvm/cmake/config-ix.cmake


Index: llvm/cmake/config-ix.cmake
===
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -348,7 +348,7 @@
 
 check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
 if( LLVM_USING_GLIBC )
-  add_definitions( -D_GNU_SOURCE )
+  add_compile_definitions(_GNU_SOURCE)
   list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
 endif()
 # This check requires _GNU_SOURCE
Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -414,8 +414,6 @@
   endif()
 endif()
 
-add_definitions( -D_GNU_SOURCE )
-
 option(CLANG_BUILD_TOOLS
   "Build the Clang tools. If OFF, just generate build targets." ON)
 


Index: llvm/cmake/config-ix.cmake
===
--- llvm/cmake/config-ix.cmake
+++ llvm/cmake/config-ix.cmake
@@ -348,7 +348,7 @@
 
 check_symbol_exists(__GLIBC__ stdio.h LLVM_USING_GLIBC)
 if( LLVM_USING_GLIBC )
-  add_definitions( -D_GNU_SOURCE )
+  add_compile_definitions(_GNU_SOURCE)
   list(APPEND CMAKE_REQUIRED_DEFINITIONS "-D_GNU_SOURCE")
 endif()
 # This check requires _GNU_SOURCE
Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -414,8 +414,6 @@
   endif()
 endif()
 
-add_definitions( -D_GNU_SOURCE )
-
 option(CLANG_BUILD_TOOLS
   "Build the Clang tools. If OFF, just generate build targets." ON)
 
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D137917: [cmake] Fix _GNU_SOURCE being added unconditionally

2022-11-14 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D137917#3925161 , @Trass3r wrote:

> Thanks could you also commit it?

Sure, what name and email should I use for you when committing?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137917

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


[PATCH] D137917: [cmake] Fix _GNU_SOURCE being added unconditionally

2022-11-14 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

I think this looks OK.  What kind of errors were you seeing before this fix?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137917

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


[PATCH] D137669: clang/cmake: Require pre-built test dependencies for stand-alone builds

2022-11-10 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D137669#3915899 , @mstorsjo wrote:

> This does, somewhat, coincide with what I'm trying to do in D131052 
> . There, I don't point out the binaries for 
> `FileCheck` and similar, but point out preexisting native `llvm-tblgen`, 
> `clang-tblgen` etc (to avoid needing to build them in a nested native cmake 
> when cross compiling) - but if they exist, they would probably be in the same 
> directory. Would it make sense to try to settle on a common variable name for 
> both of these? Or is there a case where we specifically need to be able to 
> differentiate between the two?

Do you mean creating a common variable name for the path to llvm utils?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137669

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


[PATCH] D131919: Move googletest to the third-party directory

2022-11-09 Thread Tom Stellard via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG59052468c3e3: Move googletest to the third-party directory 
(authored by tstellar).

Changed prior to commit:
  https://reviews.llvm.org/D131919?vs=468784=474310#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131919

Files:
  clang/CMakeLists.txt
  compiler-rt/CMakeLists.txt
  lld/CMakeLists.txt
  lldb/cmake/modules/LLDBStandalone.cmake
  llvm/CMakeLists.txt
  llvm/cmake/modules/HandleLLVMOptions.cmake
  llvm/utils/unittest/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/TestMain.cpp
  llvm/utils/unittest/googlemock/LICENSE.txt
  llvm/utils/unittest/googlemock/README.LLVM
  llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-cardinalities.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-function-mocker.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-actions.h
  
llvm/utils/unittest/googlemock/include/gmock/gmock-generated-function-mockers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-nice-strict.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-spec-builders.h
  llvm/utils/unittest/googlemock/include/gmock/gmock.h
  
llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-pp.h
  llvm/utils/unittest/googlemock/src/gmock-all.cc
  llvm/utils/unittest/googlemock/src/gmock-cardinalities.cc
  llvm/utils/unittest/googlemock/src/gmock-internal-utils.cc
  llvm/utils/unittest/googlemock/src/gmock-matchers.cc
  llvm/utils/unittest/googlemock/src/gmock-spec-builders.cc
  llvm/utils/unittest/googlemock/src/gmock.cc
  llvm/utils/unittest/googletest/LICENSE.TXT
  llvm/utils/unittest/googletest/README.LLVM
  llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-matchers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-message.h
  llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-spi.h
  llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h
  llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest.h
  llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h
  llvm/utils/unittest/googletest/include/gtest/gtest_prod.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h
  
llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h
  llvm/utils/unittest/googletest/src/gtest-all.cc
  llvm/utils/unittest/googletest/src/gtest-death-test.cc
  llvm/utils/unittest/googletest/src/gtest-filepath.cc
  llvm/utils/unittest/googletest/src/gtest-internal-inl.h
  llvm/utils/unittest/googletest/src/gtest-matchers.cc
  llvm/utils/unittest/googletest/src/gtest-port.cc
  llvm/utils/unittest/googletest/src/gtest-printers.cc
  llvm/utils/unittest/googletest/src/gtest-test-part.cc
  llvm/utils/unittest/googletest/src/gtest-typed-test.cc
  llvm/utils/unittest/googletest/src/gtest.cc
  mlir/CMakeLists.txt
  polly/CMakeLists.txt
  third-party/unittest/CMakeLists.txt
  third-party/unittest/UnitTestMain/CMakeLists.txt
  third-party/unittest/UnitTestMain/TestMain.cpp
  third-party/unittest/googlemock/LICENSE.txt
  third-party/unittest/googlemock/README.LLVM
  

[PATCH] D137669: clang/cmake: Require pre-built test dependencies for stand-alone builds

2022-11-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D137669#3916493 , @mgorny wrote:

> Could you issue a warning though? It's really annoying when targets disappear 
> like that and you have to guess which of the checks failed.

What about just making it an error if LLVM_INCLUDE_TESTS is set, but it kind 
find all the tools?  I also don't like the silent disabling of features, but 
I'm not sure how visible the warning would be to users.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137669

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


[PATCH] D137669: clang/cmake: Require pre-built test dependencies for stand-alone builds

2022-11-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: phosek, mgorny, Ericson2314.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

If the FileCheck, count, and not tools are not found in
LLVM_TOOLS_BINARY_DIR, then tests will be disabled.  CMake will
no longer try to build these tool from the llvm sources.

In theory, since stand-alone builds are meant to be done without
access to the llvm sources, this should be a no-op, but this
change will affect anyone trying to do stand-alone builds with
the full monorepo sources.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137669

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -86,34 +86,26 @@
   set(LLVM_UTILS_PROVIDED ON)
 endif()
 
-if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
-  # Note: path not really used, except for checking if lit was found
-  set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
-  if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
-add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
+# Seek installed Lit.
+find_program(LLVM_LIT
+ NAMES llvm-lit lit.py lit
+ PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+ DOC "Path to lit.py")
+
+if (LLVM_LIT AND LLVM_UTILS_PROVIDED)
+  if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
+# Note: path not really used, except for checking if lit was found
+if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
+  add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
+endif()
+set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
+AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+  add_subdirectory(${UNITTEST_DIR} utils/unittest)
+endif()
   endif()
-  if(NOT LLVM_UTILS_PROVIDED)
-add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/FileCheck utils/FileCheck)
-add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/count utils/count)
-add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/not utils/not)
-set(LLVM_UTILS_PROVIDED ON)
-set(CLANG_TEST_DEPS FileCheck count not)
-  endif()
-  set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
-  if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
-  AND NOT EXISTS 
${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
-  AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
-add_subdirectory(${UNITTEST_DIR} utils/unittest)
-  endif()
-else()
-  # Seek installed Lit.
-  find_program(LLVM_LIT
-   NAMES llvm-lit lit.py lit
-   PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
-   DOC "Path to lit.py")
-endif()
 
-if(LLVM_LIT)
   # Define the default arguments to use with 'lit', and an option for the 
user
   # to override.
   set(LIT_ARGS_DEFAULT "-sv")


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -86,34 +86,26 @@
   set(LLVM_UTILS_PROVIDED ON)
 endif()
 
-if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
-  # Note: path not really used, except for checking if lit was found
-  set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
-  if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
-add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
+# Seek installed Lit.
+find_program(LLVM_LIT
+ NAMES llvm-lit lit.py lit
+ PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+ DOC "Path to lit.py")
+
+if (LLVM_LIT AND LLVM_UTILS_PROVIDED)
+  if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
+# Note: path not really used, except for checking if lit was found
+if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
+  add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
+endif()
+set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
+if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
+AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
+AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
+  add_subdirectory(${UNITTEST_DIR} utils/unittest)
+endif()
   endif()
-  if(NOT LLVM_UTILS_PROVIDED)
-add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/FileCheck utils/FileCheck)
-add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/count utils/count)
-

[PATCH] D125860: [clang] Only use major version in resource dir

2022-11-08 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@tbaeder That CI failure seems unrelated.  Maybe just commit early in the day 
so you have time to deal with the bot failures (if any).


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

https://reviews.llvm.org/D125860

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


[PATCH] D131919: Move googletest to the third-party directory

2022-11-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.
Herald added a subscriber: Moerafaat.

@probinson Does this latest update look better?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131919

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


[PATCH] D137224: clang/cmake: Simplify lit detection for standalone builds

2022-11-03 Thread Tom Stellard via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc9a959334707: clang/cmake: Simplify lit detection for 
standalone builds (authored by tstellar).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137224

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -93,9 +93,14 @@
   set(LLVM_UTILS_PROVIDED ON)
 endif()
 
+# Seek installed Lit.
+find_program(LLVM_LIT
+ NAMES llvm-lit lit.py lit
+ PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+ DOC "Path to lit.py")
+
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   # Note: path not really used, except for checking if lit was found
-  set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
   endif()
@@ -112,12 +117,6 @@
   AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
 add_subdirectory(${UNITTEST_DIR} utils/unittest)
   endif()
-else()
-  # Seek installed Lit.
-  find_program(LLVM_LIT
-   NAMES llvm-lit lit.py lit
-   PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
-   DOC "Path to lit.py")
 endif()
 
 if(LLVM_LIT)


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -93,9 +93,14 @@
   set(LLVM_UTILS_PROVIDED ON)
 endif()
 
+# Seek installed Lit.
+find_program(LLVM_LIT
+ NAMES llvm-lit lit.py lit
+ PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+ DOC "Path to lit.py")
+
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   # Note: path not really used, except for checking if lit was found
-  set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
   endif()
@@ -112,12 +117,6 @@
   AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
 add_subdirectory(${UNITTEST_DIR} utils/unittest)
   endif()
-else()
-  # Seek installed Lit.
-  find_program(LLVM_LIT
-   NAMES llvm-lit lit.py lit
-   PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
-   DOC "Path to lit.py")
 endif()
 
 if(LLVM_LIT)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D137224: clang/cmake: Simplify lit detection for standalone builds

2022-11-01 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: mgorny, phosek, Ericson2314.
Herald added a project: All.
tstellar requested review of this revision.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137224

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -92,9 +92,14 @@
   set(LLVM_UTILS_PROVIDED ON)
 endif()
 
+# Seek installed Lit.
+find_program(LLVM_LIT
+ NAMES llvm-lit lit.py lit
+ PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+ DOC "Path to lit.py")
+
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   # Note: path not really used, except for checking if lit was found
-  set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
   endif()
@@ -111,12 +116,6 @@
   AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
 add_subdirectory(${UNITTEST_DIR} utils/unittest)
   endif()
-else()
-  # Seek installed Lit.
-  find_program(LLVM_LIT
-   NAMES llvm-lit lit.py lit
-   PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
-   DOC "Path to lit.py")
 endif()
 
 if(LLVM_LIT)


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -92,9 +92,14 @@
   set(LLVM_UTILS_PROVIDED ON)
 endif()
 
+# Seek installed Lit.
+find_program(LLVM_LIT
+ NAMES llvm-lit lit.py lit
+ PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
+ DOC "Path to lit.py")
+
 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   # Note: path not really used, except for checking if lit was found
-  set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
   if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/llvm-lit)
 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit utils/llvm-lit)
   endif()
@@ -111,12 +116,6 @@
   AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
 add_subdirectory(${UNITTEST_DIR} utils/unittest)
   endif()
-else()
-  # Seek installed Lit.
-  find_program(LLVM_LIT
-   NAMES llvm-lit lit.py lit
-   PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
-   DOC "Path to lit.py")
 endif()
 
 if(LLVM_LIT)
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D136660: [clang] Replace BACKEND_PACKAGE_STRING with LLVM_VERSION_STRING

2022-10-24 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.
This revision is now accepted and ready to land.

This seems fine to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136660

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


[PATCH] D131919: Move googletest to the third-party directory

2022-10-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 468784.
tstellar marked 4 inline comments as done.
tstellar added a comment.
Herald added a subscriber: zero9178.

Rebase and fix some missed path updates.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131919

Files:
  clang/CMakeLists.txt
  compiler-rt/CMakeLists.txt
  lld/CMakeLists.txt
  lldb/cmake/modules/LLDBStandalone.cmake
  llvm/CMakeLists.txt
  llvm/cmake/modules/HandleLLVMOptions.cmake
  llvm/utils/unittest/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/TestMain.cpp
  llvm/utils/unittest/googlemock/LICENSE.txt
  llvm/utils/unittest/googlemock/README.LLVM
  llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-cardinalities.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-function-mocker.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-actions.h
  
llvm/utils/unittest/googlemock/include/gmock/gmock-generated-function-mockers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-nice-strict.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-spec-builders.h
  llvm/utils/unittest/googlemock/include/gmock/gmock.h
  
llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-pp.h
  llvm/utils/unittest/googlemock/src/gmock-all.cc
  llvm/utils/unittest/googlemock/src/gmock-cardinalities.cc
  llvm/utils/unittest/googlemock/src/gmock-internal-utils.cc
  llvm/utils/unittest/googlemock/src/gmock-matchers.cc
  llvm/utils/unittest/googlemock/src/gmock-spec-builders.cc
  llvm/utils/unittest/googlemock/src/gmock.cc
  llvm/utils/unittest/googletest/LICENSE.TXT
  llvm/utils/unittest/googletest/README.LLVM
  llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-matchers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-message.h
  llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-spi.h
  llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h
  llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest.h
  llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h
  llvm/utils/unittest/googletest/include/gtest/gtest_prod.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h
  
llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h
  llvm/utils/unittest/googletest/src/gtest-all.cc
  llvm/utils/unittest/googletest/src/gtest-death-test.cc
  llvm/utils/unittest/googletest/src/gtest-filepath.cc
  llvm/utils/unittest/googletest/src/gtest-internal-inl.h
  llvm/utils/unittest/googletest/src/gtest-matchers.cc
  llvm/utils/unittest/googletest/src/gtest-port.cc
  llvm/utils/unittest/googletest/src/gtest-printers.cc
  llvm/utils/unittest/googletest/src/gtest-test-part.cc
  llvm/utils/unittest/googletest/src/gtest-typed-test.cc
  llvm/utils/unittest/googletest/src/gtest.cc
  mlir/CMakeLists.txt
  polly/CMakeLists.txt
  third-party/unittest/CMakeLists.txt
  third-party/unittest/UnitTestMain/CMakeLists.txt
  third-party/unittest/UnitTestMain/TestMain.cpp
  third-party/unittest/googlemock/LICENSE.txt
  third-party/unittest/googlemock/README.LLVM
  third-party/unittest/googlemock/include/gmock/gmock-actions.h
  third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h

[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-10-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D134337#3865753 , @mgorny wrote:

> In D134337#3865541 , @tstellar 
> wrote:
>
>> I know I'm a little late here, but having a default config file that's 
>> always loaded makes triaging issues much harder, because now every time 
>> someone files a bug, we need to ask for the contents of their config 
>> directory.
>
> I don't see that as much worse than asking them for the values of `*DEFAULT*` 
> CMake options or whether they have patched their clang because the driver 
> code makes so many specific assumptions that it didn't work for them. At 
> least `clang -v` tells us whether they are actually using any configs.

At least as a distro maintainer, I know the CMake options used for the packages 
I'm trying to support.

I was also wondering, would it be possible to move some of the targets specific 
driver code out of the codebase and into config files that are shipped with 
clang?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134337

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


[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-10-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D134337#3864288 , @mgorny wrote:

> In D134337#3863744 , @tstellar 
> wrote:
>
>> In what scenarios will clang load the clang.cfg file?
>
> It will load it if all of the following are true:
>
> 1. `--no-default-config` is **not** passed.
> 2. a more specific `-clang.cfg` is not found.
> 3. `--driver-mode=gcc` is in effect **or** the executable is named `clang` or 
> `*-clang` and `--driver-mode=` did not select another config file.

I know I'm a little late here, but having a default config file that's always 
loaded makes triaging issues much harder, because now every time someone files 
a bug, we need to ask for the contents of their config directory.




Comment at: clang/docs/UsersManual.rst:954
+
+For example, ``x86_64-pc-linux-gnu-clang-g++`` will attempt to load two
+configuration files named respectively::

mgorny wrote:
> tstellar wrote:
> > Is `x86_64-pc-linux-gnu-clang-g++ ` being passed to --driver= in this 
> > example?
> I don't understand your question. `x86_64-pc-linux-gnu-clang-g++` is the 
> executable (symlink) name here.
OK, it's a symlink.  That makes sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134337

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


[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-10-17 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In what scenarios will clang load the clang.cfg file?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134337

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


[PATCH] D134337: [clang] [Driver] More flexible rules for loading default configs

2022-10-17 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/docs/UsersManual.rst:954
+
+For example, ``x86_64-pc-linux-gnu-clang-g++`` will attempt to load two
+configuration files named respectively::

Is `x86_64-pc-linux-gnu-clang-g++ ` being passed to --driver= in this example?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134337

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


[PATCH] D130586: [cmake] Use `CMAKE_INSTALL_LIBDIR` too

2022-08-19 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D130586#3734012 , @Ericson2314 
wrote:

> Sorry. I have reverted this. I see why the `lib` and `lib64` mixup could be 
> caused by this, but I am baffled how the missing headers could be.  Headers 
> search paths should be unaffected?

I think there may be code somewhere that computes header paths as relative to 
the lib paths.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130586

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


[PATCH] D118511: Add a warning for not packing non-POD members in packed structs

2022-08-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@dblaikie Can you file a bug and add the 15.0.0 Release Milestone, so we don't 
forget to fix this in the release branch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118511

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


[PATCH] D117616: GCC ABI Compatibility: Preserve alignment of non-pod members in packed structs

2022-08-18 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a subscriber: thieta.
tstellar added a comment.

@dblaikie Is there anything we need to do in the release branch for this still? 
cc @thieta


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117616

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


[PATCH] D131919: Move googletest to the third-party directory

2022-08-16 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 453194.
tstellar added a comment.

Rebase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131919

Files:
  clang/CMakeLists.txt
  compiler-rt/CMakeLists.txt
  lld/CMakeLists.txt
  lldb/cmake/modules/LLDBStandalone.cmake
  llvm/CMakeLists.txt
  llvm/cmake/modules/HandleLLVMOptions.cmake
  llvm/utils/unittest/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/TestMain.cpp
  llvm/utils/unittest/googlemock/LICENSE.txt
  llvm/utils/unittest/googlemock/README.LLVM
  llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-cardinalities.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-function-mocker.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-actions.h
  
llvm/utils/unittest/googlemock/include/gmock/gmock-generated-function-mockers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-nice-strict.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-spec-builders.h
  llvm/utils/unittest/googlemock/include/gmock/gmock.h
  
llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-pp.h
  llvm/utils/unittest/googlemock/src/gmock-all.cc
  llvm/utils/unittest/googlemock/src/gmock-cardinalities.cc
  llvm/utils/unittest/googlemock/src/gmock-internal-utils.cc
  llvm/utils/unittest/googlemock/src/gmock-matchers.cc
  llvm/utils/unittest/googlemock/src/gmock-spec-builders.cc
  llvm/utils/unittest/googlemock/src/gmock.cc
  llvm/utils/unittest/googletest/LICENSE.TXT
  llvm/utils/unittest/googletest/README.LLVM
  llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-matchers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-message.h
  llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-spi.h
  llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h
  llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest.h
  llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h
  llvm/utils/unittest/googletest/include/gtest/gtest_prod.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h
  
llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h
  llvm/utils/unittest/googletest/src/gtest-all.cc
  llvm/utils/unittest/googletest/src/gtest-death-test.cc
  llvm/utils/unittest/googletest/src/gtest-filepath.cc
  llvm/utils/unittest/googletest/src/gtest-internal-inl.h
  llvm/utils/unittest/googletest/src/gtest-matchers.cc
  llvm/utils/unittest/googletest/src/gtest-port.cc
  llvm/utils/unittest/googletest/src/gtest-printers.cc
  llvm/utils/unittest/googletest/src/gtest-test-part.cc
  llvm/utils/unittest/googletest/src/gtest-typed-test.cc
  llvm/utils/unittest/googletest/src/gtest.cc
  mlir/CMakeLists.txt
  polly/CMakeLists.txt
  third-party/unittest/CMakeLists.txt
  third-party/unittest/UnitTestMain/CMakeLists.txt
  third-party/unittest/UnitTestMain/TestMain.cpp
  third-party/unittest/googlemock/LICENSE.txt
  third-party/unittest/googlemock/README.LLVM
  third-party/unittest/googlemock/include/gmock/gmock-actions.h
  third-party/unittest/googlemock/include/gmock/gmock-cardinalities.h
  third-party/unittest/googlemock/include/gmock/gmock-function-mocker.h
  

[PATCH] D131919: Move googletest to the third-party directory

2022-08-15 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:1257
+
+set(LLVM_THIRD_PARTY_DIR  ${CMAKE_CURRENT_SOURCE_DIR}/../third-party CACHE 
STRING
+"Directory containing third party software used by LLVM (e.g. googletest)")

stellaraccident wrote:
> Is the implication that this file should only ever be included by top-level 
> sub-projects (i.e. clang, mlir, llvm, etc)? If included from elsewhere, it 
> seems like it won't do the right thing.
> 
> Also, having this as a cache entry is going to make it harder for out of tree 
> projects to define it reliably (requiring various FORCE heroics) -- but I 
> know why you are doing it if trying to define it here.
> 
> As is, this file is included from most of the top-levels and making it a 
> cache variable will have them racing to set it. Why not make it a regular 
> variable? And why not derive it from LLVM_MAIN_SRC_DIR?
I put it in this file so that this variable would be available for stand-alone 
builds and made it a cache variable so it could be overridden by standalone 
builds too.

The alternative would be to define this variable in llvm/CMakeLists.txt and 
then in the stand-alone build handling for each sub-project.  It's a lot of 
code duplication that way, but we already have a lot of similar duplication in 
the CMakeLists.txt today (this is something I would like to clean up in the 
future).

Using LLVM_MAIN_SRC_DIR here breaks stand-alone builds, because 
LLVM_MAIN_SRC_DIR expands to ../llvm/../, so if I try to build lld, with a 
directory layout of:

```
lld/ cmake/ third-party/
```

Then CMake won't be able to find the third-party/ directory even though it is 
in the right place (because llvm/ is missing).  I also think in general, it's 
cleaner to only use LLVM_MAIN_SRC_DIR when we want to use files in llvm/ and 
not for finding the root of the monorepo.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131919

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


[PATCH] D131919: Move googletest to the third-party directory

2022-08-15 Thread Tom Stellard via Phabricator via cfe-commits
tstellar created this revision.
tstellar added reviewers: stellaraccident, rnk, lattner, probinson, jyknight, 
phosek.
Herald added subscribers: Enna1, bzcheeseman, sdasgup3, wenzhicui, wrengr, 
mstorsjo, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, 
grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, 
shauheen, rriddle, mehdi_amini, mgrang, fedor.sergeev, krytarowski, mgorny, 
dschuff.
Herald added a reviewer: bollu.
Herald added a project: All.
tstellar requested review of this revision.
Herald added subscribers: lldb-commits, Sanitizers, cfe-commits, 
stephenneuendorffer, nicolasvasilache.
Herald added projects: clang, Sanitizers, LLDB, MLIR, LLVM.

This will help improve the project's layering, so that sub-projects
that don't actually need any llvm code can still use googletest
without having to reference code in the llvm directory.

This will also make it easier to consolidate and simplify the standalone
build configurations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131919

Files:
  clang/CMakeLists.txt
  compiler-rt/CMakeLists.txt
  lld/CMakeLists.txt
  lldb/cmake/modules/LLDBStandalone.cmake
  llvm/CMakeLists.txt
  llvm/cmake/modules/HandleLLVMOptions.cmake
  llvm/utils/unittest/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/CMakeLists.txt
  llvm/utils/unittest/UnitTestMain/TestMain.cpp
  llvm/utils/unittest/googlemock/LICENSE.txt
  llvm/utils/unittest/googlemock/README.LLVM
  llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-cardinalities.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-function-mocker.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-actions.h
  
llvm/utils/unittest/googlemock/include/gmock/gmock-generated-function-mockers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-generated-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-actions.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-more-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-nice-strict.h
  llvm/utils/unittest/googlemock/include/gmock/gmock-spec-builders.h
  llvm/utils/unittest/googlemock/include/gmock/gmock.h
  
llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-matchers.h
  llvm/utils/unittest/googlemock/include/gmock/internal/custom/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-internal-utils.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-port.h
  llvm/utils/unittest/googlemock/include/gmock/internal/gmock-pp.h
  llvm/utils/unittest/googlemock/src/gmock-all.cc
  llvm/utils/unittest/googlemock/src/gmock-cardinalities.cc
  llvm/utils/unittest/googlemock/src/gmock-internal-utils.cc
  llvm/utils/unittest/googlemock/src/gmock-matchers.cc
  llvm/utils/unittest/googlemock/src/gmock-spec-builders.cc
  llvm/utils/unittest/googlemock/src/gmock.cc
  llvm/utils/unittest/googletest/LICENSE.TXT
  llvm/utils/unittest/googletest/README.LLVM
  llvm/utils/unittest/googletest/include/gtest/gtest-death-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-matchers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-message.h
  llvm/utils/unittest/googletest/include/gtest/gtest-param-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/gtest-spi.h
  llvm/utils/unittest/googletest/include/gtest/gtest-test-part.h
  llvm/utils/unittest/googletest/include/gtest/gtest-typed-test.h
  llvm/utils/unittest/googletest/include/gtest/gtest.h
  llvm/utils/unittest/googletest/include/gtest/gtest_pred_impl.h
  llvm/utils/unittest/googletest/include/gtest/gtest_prod.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest-printers.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/gtest.h
  llvm/utils/unittest/googletest/include/gtest/internal/custom/raw-ostream.h
  
llvm/utils/unittest/googletest/include/gtest/internal/gtest-death-test-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-filepath.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-internal.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-param-util.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port-arch.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-port.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-string.h
  llvm/utils/unittest/googletest/include/gtest/internal/gtest-type-util.h
  llvm/utils/unittest/googletest/src/gtest-all.cc
  llvm/utils/unittest/googletest/src/gtest-death-test.cc
  llvm/utils/unittest/googletest/src/gtest-filepath.cc
  llvm/utils/unittest/googletest/src/gtest-internal-inl.h

[PATCH] D123967: Disable update_cc_test_checks.py tests in stand-alone builds

2022-08-11 Thread Tom Stellard via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG74384c7fcec7: Disable update_cc_test_checks.py tests in 
stand-alone builds (authored by tstellar).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123967

Files:
  clang/test/CMakeLists.txt
  clang/test/lit.site.cfg.py.in
  clang/test/utils/update_cc_test_checks/lit.local.cfg


Index: clang/test/utils/update_cc_test_checks/lit.local.cfg
===
--- clang/test/utils/update_cc_test_checks/lit.local.cfg
+++ clang/test/utils/update_cc_test_checks/lit.local.cfg
@@ -10,27 +10,36 @@
 from pipes import quote as shell_quote
 
 
-config.test_format = lit.formats.ShTest(execute_external=False)
-config.suffixes = ['.test']
-
-clang_path = os.path.join(config.clang_tools_dir, 'clang')
-extra_args = '--clang ' + shell_quote(clang_path)
-opt_path = os.path.join(config.llvm_tools_dir, 'opt')
-extra_args += ' --opt ' + shell_quote(opt_path)
-script_path = os.path.join(config.llvm_src_root, 'utils',
-   'update_cc_test_checks.py')
-assert os.path.isfile(script_path)
-# Windows: llvm-lit.py, Linux: llvm-lit
-if config.llvm_external_lit:
-lit = config.llvm_external_lit
+if config.standalone_build:
+# These tests require the update_cc_test_checks.py script from the llvm
+# source tree, so skip these tests if we are doing standalone builds.
+# These tests are only relevant to developers working with the
+# update_cc_test_checks.py tool; they don't provide any coverage
+# for any of the clang source code.
+config.unsupported = True
 else:
-lit = shell_quote(glob.glob(os.path.join(config.llvm_tools_dir, 
'llvm-lit*'))[0])
-python = shell_quote(config.python_executable)
-config.substitutions.append(
-('%update_cc_test_checks', "%s %s %s" % (
-python, shell_quote(script_path), extra_args)))
-config.substitutions.append(
-('%clang_tools_dir', shell_quote(config.clang_tools_dir)))
-config.substitutions.append(
-('%lit', "%s %s -Dclang_lit_site_cfg=%s -j1 -vv" % (
-python, lit, shell_quote(config.clang_lit_site_cfg
+
+config.test_format = lit.formats.ShTest(execute_external=False)
+config.suffixes = ['.test']
+
+clang_path = os.path.join(config.clang_tools_dir, 'clang')
+extra_args = '--clang ' + shell_quote(clang_path)
+opt_path = os.path.join(config.llvm_tools_dir, 'opt')
+extra_args += ' --opt ' + shell_quote(opt_path)
+script_path = os.path.join(config.llvm_src_root, 'utils',
+   'update_cc_test_checks.py')
+assert os.path.isfile(script_path)
+# Windows: llvm-lit.py, Linux: llvm-lit
+if config.llvm_external_lit:
+lit = config.llvm_external_lit
+else:
+lit = shell_quote(glob.glob(os.path.join(config.llvm_tools_dir, 
'llvm-lit*'))[0])
+python = shell_quote(config.python_executable)
+config.substitutions.append(
+('%update_cc_test_checks', "%s %s %s" % (
+python, shell_quote(script_path), extra_args)))
+config.substitutions.append(
+('%clang_tools_dir', shell_quote(config.clang_tools_dir)))
+config.substitutions.append(
+('%lit', "%s %s -Dclang_lit_site_cfg=%s -j1 -vv" % (
+python, lit, shell_quote(config.clang_lit_site_cfg
Index: clang/test/lit.site.cfg.py.in
===
--- clang/test/lit.site.cfg.py.in
+++ clang/test/lit.site.cfg.py.in
@@ -37,6 +37,7 @@
 config.has_plugins = @CLANG_PLUGIN_SUPPORT@
 config.clang_vendor_uti = "@CLANG_VENDOR_UTI@"
 config.llvm_external_lit = path(r"@LLVM_EXTERNAL_LIT@")
+config.standalone_build = @CLANG_BUILT_STANDALONE@
 
 import lit.llvm
 lit.llvm.initialize(lit_config, config)
Index: clang/test/CMakeLists.txt
===
--- clang/test/CMakeLists.txt
+++ clang/test/CMakeLists.txt
@@ -3,6 +3,7 @@
 
 llvm_canonicalize_cmake_booleans(
   CLANG_BUILD_EXAMPLES
+  CLANG_BUILT_STANDALONE
   CLANG_DEFAULT_PIE_ON_LINUX
   CLANG_ENABLE_OPAQUE_POINTERS_INTERNAL
   CLANG_ENABLE_ARCMT


Index: clang/test/utils/update_cc_test_checks/lit.local.cfg
===
--- clang/test/utils/update_cc_test_checks/lit.local.cfg
+++ clang/test/utils/update_cc_test_checks/lit.local.cfg
@@ -10,27 +10,36 @@
 from pipes import quote as shell_quote
 
 
-config.test_format = lit.formats.ShTest(execute_external=False)
-config.suffixes = ['.test']
-
-clang_path = os.path.join(config.clang_tools_dir, 'clang')
-extra_args = '--clang ' + shell_quote(clang_path)
-opt_path = os.path.join(config.llvm_tools_dir, 'opt')
-extra_args += ' --opt ' + shell_quote(opt_path)
-script_path = 

[PATCH] D123967: Disable update_cc_test_checks.py tests in stand-alone builds

2022-08-10 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@h-vetinari Do these updates look OK to you?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123967

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


[PATCH] D129973: [clang] Pass FoundDecl to DeclRefExpr creator for operator overloads

2022-08-09 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

The revert doesn't apply cleanly, can someone try to fix it up: 
https://github.com/llvm/llvm-project/issues/56928#issuecomment-1205483442


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129973

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


[PATCH] D131172: [clang][llvm][doc] Add more information for the ABI change in FP16

2022-08-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@pengfei You can commit this directly to the release/15.x branch whenever you 
are ready.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131172

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


[PATCH] D128777: clang/cmake: Drop use of llvm-config for LLVM install discovery

2022-08-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

@Ericson2314 Your version of these patches removed a few more things than mine 
(which seems better to me), do you want to just split your patch and commit the 
parts separately?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128777

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


[PATCH] D129973: [clang] Pass FoundDecl to DeclRefExpr creator for operator overloads

2022-08-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D129973#3699055 , @kadircet wrote:

> Reverted in df48e3fbcc8be1f4c04bd97517d12e662f54de75 
> , 
> @tstellar it needs to be cherry-picked into release branch as well.

Thanks for letting me know, I will make sure this gets backported: 
https://github.com/llvm/llvm-project/issues/56928


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129973

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


[PATCH] D130735: [Clang][LLD][cmake] Drop deprecated support for `llvm-config`-based build

2022-08-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar accepted this revision.
tstellar added a comment.

LGTM.  I just tested this patch in our build config and it works fine.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130735

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


[PATCH] D130735: [Clang][LLD][cmake] Drop deprecated support for `llvm-config`-based build

2022-08-04 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

In D130735#3691016 , @Ericson2314 
wrote:

> Should I wait for anyone else / do something like announcing this on 
> discourse?
>
> It looks like the only other use case is libclc, which sadly only supports 
> the old way so we will need to do another deprecation cycle I'd think for it.

I think it is fine to drop it from libclc without deprecating it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130735

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


[PATCH] D128777: clang/cmake: Drop use of llvm-config for LLVM install discovery

2022-08-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/CMakeLists.txt:21-23
+  set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
+  # Pull values from LLVMConfig.cmake.
+  set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")

tstellar wrote:
> This doesn't look right (even though it passes my testing).  I need to update 
> this part of the patch.
I fixed this by removing of of the existing code that copied values from 
LLVMConfig.cmake.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128777

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


[PATCH] D128777: clang/cmake: Drop use of llvm-config for LLVM install discovery

2022-08-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 449857.
tstellar added a comment.

Remove more of the existing code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128777

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -15,84 +15,17 @@
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
 
-  # Rely on llvm-config.
-  set(LLVM_CONFIG_OUTPUT)
-  if(LLVM_CONFIG)
-set (LLVM_CONFIG_FOUND 1)
-message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
-  deprecated.  The installed cmake files should be used \
-  instead.  CMake should be able to detect your LLVM install \
-  automatically, but you can also use LLVM_DIR to specify \
-  the path containing LLVMConfig.cmake.")
-set(CONFIG_COMMAND ${LLVM_CONFIG}
-  "--includedir"
-  "--prefix"
-  "--src-root"
-  "--cmakedir"
-  "--bindir"
-  "--libdir"
-  "--assertion-mode"
-  )
-execute_process(
-  COMMAND ${CONFIG_COMMAND}
-  RESULT_VARIABLE HAD_ERROR
-  OUTPUT_VARIABLE LLVM_CONFIG_OUTPUT
-)
-if(NOT HAD_ERROR)
-  string(REGEX REPLACE
-"[ \t]*[\r\n]+[ \t]*" ";"
-LLVM_CONFIG_OUTPUT ${LLVM_CONFIG_OUTPUT})
-else()
-  string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
-  message(STATUS "${CONFIG_COMMAND_STR}")
-  message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
-endif()
-
-list(GET LLVM_CONFIG_OUTPUT 0 MAIN_INCLUDE_DIR)
-list(GET LLVM_CONFIG_OUTPUT 1 LLVM_OBJ_ROOT)
-list(GET LLVM_CONFIG_OUTPUT 2 MAIN_SRC_DIR)
-list(GET LLVM_CONFIG_OUTPUT 3 LLVM_CONFIG_CMAKE_DIR)
-list(GET LLVM_CONFIG_OUTPUT 4 TOOLS_BINARY_DIR)
-list(GET LLVM_CONFIG_OUTPUT 5 LIBRARY_DIR)
-list(GET LLVM_CONFIG_OUTPUT 6 ENABLE_ASSERTIONS)
-
-# Normalize LLVM_CMAKE_DIR. --cmakedir might contain backslashes.
-# CMake assumes slashes as PATH.
-file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_DIR} LLVM_CMAKE_DIR)
-  endif()
-
-
-  if(NOT MSVC_IDE)
-set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
-  CACHE BOOL "Enable assertions")
-# Assertions should follow llvm-config's.
-mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
-  endif()
-
-  find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
+  find_package(LLVM REQUIRED)
   list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
 
-  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
-  # LLVM_CONFIG.
-  if (NOT LLVM_CONFIG_FOUND)
-# Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
-# path is removed.
-set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-# N.B. this is just a default value, the CACHE PATHs below can be 
overriden.
-set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
-set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
-  else()
-set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-  endif()
+  # N.B. this is just a default value, the CACHE PATHs below can be overriden.
+  set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
 
-  set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and 
any other header dirs needed")
-  set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")
+  set(LLVM_INCLUDE_DIRS "${LLVM_INCLUDE_DIRS}" CACHE PATH "Path to 
llvm/include and any other header dirs needed")
+  set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}" CACHE PATH "Path to LLVM build 
tree")
   set(LLVM_MAIN_SRC_DIR "${MAIN_SRC_DIR}" CACHE PATH "Path to LLVM source 
tree")
-  set(LLVM_TOOLS_BINARY_DIR "${TOOLS_BINARY_DIR}" CACHE PATH "Path to 
llvm/bin")
-  set(LLVM_LIBRARY_DIR "${LIBRARY_DIR}" CACHE PATH "Path to llvm/lib")
+  set(LLVM_TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}" CACHE PATH "Path to 
llvm/bin")
+  set(LLVM_LIBRARY_DIR "${LLVM_LIBRARY_DIR}" CACHE PATH "Path to llvm/lib")
 
   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
 NO_DEFAULT_PATH)


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -15,84 +15,17 @@
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
 
-  # Rely on llvm-config.
-  set(LLVM_CONFIG_OUTPUT)
-  if(LLVM_CONFIG)
-set (LLVM_CONFIG_FOUND 1)
-message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
-  deprecated.  The installed cmake files should be used \
-  instead.  CMake should be able to detect your LLVM install \
-  automatically, but you can also use LLVM_DIR to specify \

[PATCH] D130553: [clang][lld][cmake] Simplify header dirs

2022-08-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added a comment.

> When LLVM is being built, the list is two elements long: generated headers 
> and headers from source.

All these changes are guarded by if (CLANG_BUILT_STANDALONE), which means LLVM 
should already be built.  What build configuration are you using where you 
needed this change?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130553

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


[PATCH] D128777: clang/cmake: Drop use of llvm-config for LLVM install discovery

2022-08-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/CMakeLists.txt:21-23
+  set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
+  # Pull values from LLVMConfig.cmake.
+  set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")

This doesn't look right (even though it passes my testing).  I need to update 
this part of the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128777

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


[PATCH] D128777: clang/cmake: Drop use of llvm-config for LLVM install discovery

2022-08-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar updated this revision to Diff 449783.
tstellar added a comment.

Rebase.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128777

Files:
  clang/CMakeLists.txt


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -15,78 +15,17 @@
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
 
-  # Rely on llvm-config.
-  set(LLVM_CONFIG_OUTPUT)
-  if(LLVM_CONFIG)
-set (LLVM_CONFIG_FOUND 1)
-message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
-  deprecated.  The installed cmake files should be used \
-  instead.  CMake should be able to detect your LLVM install \
-  automatically, but you can also use LLVM_DIR to specify \
-  the path containing LLVMConfig.cmake.")
-set(CONFIG_COMMAND ${LLVM_CONFIG}
-  "--includedir"
-  "--prefix"
-  "--src-root"
-  "--cmakedir"
-  "--bindir"
-  "--libdir"
-  "--assertion-mode"
-  )
-execute_process(
-  COMMAND ${CONFIG_COMMAND}
-  RESULT_VARIABLE HAD_ERROR
-  OUTPUT_VARIABLE LLVM_CONFIG_OUTPUT
-)
-if(NOT HAD_ERROR)
-  string(REGEX REPLACE
-"[ \t]*[\r\n]+[ \t]*" ";"
-LLVM_CONFIG_OUTPUT ${LLVM_CONFIG_OUTPUT})
-else()
-  string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
-  message(STATUS "${CONFIG_COMMAND_STR}")
-  message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
-endif()
-
-list(GET LLVM_CONFIG_OUTPUT 0 MAIN_INCLUDE_DIR)
-list(GET LLVM_CONFIG_OUTPUT 1 LLVM_OBJ_ROOT)
-list(GET LLVM_CONFIG_OUTPUT 2 MAIN_SRC_DIR)
-list(GET LLVM_CONFIG_OUTPUT 3 LLVM_CONFIG_CMAKE_DIR)
-list(GET LLVM_CONFIG_OUTPUT 4 TOOLS_BINARY_DIR)
-list(GET LLVM_CONFIG_OUTPUT 5 LIBRARY_DIR)
-list(GET LLVM_CONFIG_OUTPUT 6 ENABLE_ASSERTIONS)
-
-# Normalize LLVM_CMAKE_DIR. --cmakedir might contain backslashes.
-# CMake assumes slashes as PATH.
-file(TO_CMAKE_PATH ${LLVM_CONFIG_CMAKE_DIR} LLVM_CMAKE_DIR)
-  endif()
-
-
-  if(NOT MSVC_IDE)
-set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
-  CACHE BOOL "Enable assertions")
-# Assertions should follow llvm-config's.
-mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
-  endif()
-
   find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
   list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
 
-  # We can't check LLVM_CONFIG here, because find_package(LLVM ...) also sets
-  # LLVM_CONFIG.
-  if (NOT LLVM_CONFIG_FOUND)
-# Pull values from LLVMConfig.cmake.  We can drop this once the llvm-config
-# path is removed.
-set(INCLUDE_DIRS ${LLVM_INCLUDE_DIRS})
-set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
-# N.B. this is just a default value, the CACHE PATHs below can be 
overriden.
-set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
-set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
-set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
-  else()
-set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
-  endif()
+  set(INCLUDE_DIRS "${LLVM_BINARY_DIR}/include" "${MAIN_INCLUDE_DIR}")
+  # Pull values from LLVMConfig.cmake.
+  set(MAIN_INCLUDE_DIR "${LLVM_INCLUDE_DIR}")
+  set(LLVM_OBJ_DIR "${LLVM_BINARY_DIR}")
+  # N.B. this is just a default value, the CACHE PATHs below can be overriden.
+  set(MAIN_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../llvm")
+  set(TOOLS_BINARY_DIR "${LLVM_TOOLS_BINARY_DIR}")
+  set(LIBRARY_DIR "${LLVM_LIBRARY_DIR}")
 
   set(LLVM_INCLUDE_DIRS ${INCLUDE_DIRS} CACHE PATH "Path to llvm/include and 
any other header dirs needed")
   set(LLVM_BINARY_DIR "${LLVM_OBJ_ROOT}" CACHE PATH "Path to LLVM build tree")


Index: clang/CMakeLists.txt
===
--- clang/CMakeLists.txt
+++ clang/CMakeLists.txt
@@ -15,78 +15,17 @@
   set(CMAKE_CXX_STANDARD_REQUIRED YES)
   set(CMAKE_CXX_EXTENSIONS NO)
 
-  # Rely on llvm-config.
-  set(LLVM_CONFIG_OUTPUT)
-  if(LLVM_CONFIG)
-set (LLVM_CONFIG_FOUND 1)
-message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
-message(DEPRECATION "Using llvm-config to detect the LLVM installation is \
-  deprecated.  The installed cmake files should be used \
-  instead.  CMake should be able to detect your LLVM install \
-  automatically, but you can also use LLVM_DIR to specify \
-  the path containing LLVMConfig.cmake.")
-set(CONFIG_COMMAND ${LLVM_CONFIG}
-  "--includedir"
-  "--prefix"
-  "--src-root"
-  "--cmakedir"
-  "--bindir"
-  "--libdir"
-  "--assertion-mode"
-  )
-execute_process(
-  COMMAND ${CONFIG_COMMAND}
-  RESULT_VARIABLE HAD_ERROR
-  OUTPUT_VARIABLE LLVM_CONFIG_OUTPUT
-)
-if(NOT HAD_ERROR)
-  string(REGEX REPLACE
-"[ \t]*[\r\n]+[ \t]*" 

[PATCH] D123967: Disable update_cc_test_checks.py tests in stand-alone builds

2022-08-03 Thread Tom Stellard via Phabricator via cfe-commits
tstellar added inline comments.



Comment at: clang/test/utils/update_cc_test_checks/lit.local.cfg:19
+# for any of the clang source code.
+config.unsupported = True
 else:

h-vetinari wrote:
> I couldn't tell from the diff where this is used (though admittedly I hardly 
> know the LLVM infra). I also don't see it in [[ 
> https://github.com/llvm/llvm-project/blob/main/clang/test/lit.cfg.py | 
> `lit.cfg.py` ]], the respective [[ 
> https://github.com/llvm/llvm-project/blob/main/clang/test/CMakeLists.txt | 
> `CMakeLists.txt` ]] or [[ 
> https://github.com/llvm/llvm-project/blob/llvmorg-14.0.6/llvm/cmake/modules/AddLLVM.cmake#L1616
>  | `configure_lit_site_cfg` ]]
> 
> I trust that this does what's intended.
The lit tool uses this to decide whether or not to run the tests in the 
directory.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123967

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


  1   2   3   4   >