[llvm-branch-commits] [clang] 0a32d93 - [clang-format] Avoid considering include directive as a template closer.

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Marek Kurdej
Date: 2021-01-29T21:43:35-08:00
New Revision: 0a32d93bd95b7ad0a4c7f91955c6c815150df84c

URL: 
https://github.com/llvm/llvm-project/commit/0a32d93bd95b7ad0a4c7f91955c6c815150df84c
DIFF: 
https://github.com/llvm/llvm-project/commit/0a32d93bd95b7ad0a4c7f91955c6c815150df84c.diff

LOG: [clang-format] Avoid considering include directive as a template closer.

This fixes a bug [[ http://llvm.org/PR48891 | PR48891 ]] introduced in D93839 
where:
```
#include 
namespace rep {}
```
got formatted as
```
#include 
namespace rep {
}
```

Reviewed By: MyDeveloperDay, leonardchan

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

(cherry picked from commit e3713f156b8cb65a2b74f150afb824ce1e2a2fab)

Added: 


Modified: 
clang/lib/Format/UnwrappedLineFormatter.cpp
clang/unittests/Format/FormatTest.cpp

Removed: 




diff  --git a/clang/lib/Format/UnwrappedLineFormatter.cpp 
b/clang/lib/Format/UnwrappedLineFormatter.cpp
index d1138bbc9c36..5dd0ccdfa6fd 100644
--- a/clang/lib/Format/UnwrappedLineFormatter.cpp
+++ b/clang/lib/Format/UnwrappedLineFormatter.cpp
@@ -371,7 +371,7 @@ class LineJoiner {
 if (Previous->is(tok::comment))
   Previous = Previous->getPreviousNonComment();
 if (Previous) {
-  if (Previous->is(tok::greater))
+  if (Previous->is(tok::greater) && !I[-1]->InPPDirective)
 return 0;
   if (Previous->is(tok::identifier)) {
 const FormatToken *PreviousPrevious =

diff  --git a/clang/unittests/Format/FormatTest.cpp 
b/clang/unittests/Format/FormatTest.cpp
index 855cf0242fe9..c1f88b9ae17a 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -10248,6 +10248,21 @@ TEST_F(FormatTest, SplitEmptyClass) {
"{\n"
"};",
Style);
+
+  verifyFormat("#include \"stdint.h\"\n"
+   "namespace rep {}",
+   Style);
+  verifyFormat("#include \n"
+   "namespace rep {}",
+   Style);
+  verifyFormat("#include \n"
+   "namespace rep {}",
+   "#include \n"
+   "namespace rep {\n"
+   "\n"
+   "\n"
+   "}",
+   Style);
 }
 
 TEST_F(FormatTest, SplitEmptyStruct) {



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


[llvm-branch-commits] [clang] 8c5d184 - clang: Fix static_assert in a few contexts in microsoft mode

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Nico Weber
Date: 2021-01-29T21:55:02-08:00
New Revision: 8c5d184ef714dcf435784e21e66b4b5e25b2dffb

URL: 
https://github.com/llvm/llvm-project/commit/8c5d184ef714dcf435784e21e66b4b5e25b2dffb
DIFF: 
https://github.com/llvm/llvm-project/commit/8c5d184ef714dcf435784e21e66b4b5e25b2dffb.diff

LOG: clang: Fix static_assert in a few contexts in microsoft mode

Follow-up to D17444. Fixes PR48904. See bug for details.

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

(cherry picked from commit 764a7a2155c6747ec8d0b38d8edbb65960eae874)

Added: 


Modified: 
clang/lib/Parse/ParseDecl.cpp
clang/test/Sema/static-assert.c

Removed: 




diff  --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 571164139630..347d992b1643 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -4216,7 +4216,7 @@ void Parser::ParseStructUnionBody(SourceLocation 
RecordLoc,
 }
 
 // Parse _Static_assert declaration.
-if (Tok.is(tok::kw__Static_assert)) {
+if (Tok.isOneOf(tok::kw__Static_assert, tok::kw_static_assert)) {
   SourceLocation DeclEnd;
   ParseStaticAssertDeclaration(DeclEnd);
   continue;
@@ -5180,6 +5180,7 @@ bool Parser::isDeclarationSpecifier(bool 
DisambiguatingWithExpression) {
   case tok::kw_friend:
 
 // static_assert-declaration
+  case tok::kw_static_assert:
   case tok::kw__Static_assert:
 
 // GNU typeof support.

diff  --git a/clang/test/Sema/static-assert.c b/clang/test/Sema/static-assert.c
index f08e557fc8ea..9105f2366985 100644
--- a/clang/test/Sema/static-assert.c
+++ b/clang/test/Sema/static-assert.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -std=c11 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fms-compatibility -DMS -fsyntax-only -verify %s
 // RUN: %clang_cc1 -std=c99 -pedantic -fsyntax-only -verify=expected,ext %s
 // RUN: %clang_cc1 -xc++ -std=c++11 -pedantic -fsyntax-only 
-verify=expected,ext,cxx %s
 
@@ -11,10 +12,17 @@ _Static_assert(1, "1 is nonzero"); // ext-warning 
{{'_Static_assert' is a C11 ex
 _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed "0 
is nonzero"}} \
// ext-warning {{'_Static_assert' is a C11 
extension}}
 
+#ifdef MS
+static_assert(1, "1 is nonzero");
+#endif
+
 void foo(void) {
   _Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a 
C11 extension}}
   _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed 
"0 is nonzero"}} \
  // ext-warning {{'_Static_assert' is a 
C11 extension}}
+#ifdef MS
+  static_assert(1, "1 is nonzero");
+#endif
 }
 
 _Static_assert(1, invalid); // expected-error {{expected string literal for 
diagnostic message in static_assert}} \
@@ -25,6 +33,9 @@ struct A {
   _Static_assert(1, "1 is nonzero"); // ext-warning {{'_Static_assert' is a 
C11 extension}}
   _Static_assert(0, "0 is nonzero"); // expected-error {{static_assert failed 
"0 is nonzero"}} \
  // ext-warning {{'_Static_assert' is a 
C11 extension}}
+#ifdef MS
+  static_assert(1, "1 is nonzero");
+#endif
 };
 
 #ifdef __cplusplus



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


[llvm-branch-commits] [clang-tools-extra] 1edbbf9 - [clangd] Log warning when using legacy (theia) semantic highlighting.

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Sam McCall
Date: 2021-01-29T21:56:27-08:00
New Revision: 1edbbf9d20d9f859f7ff2a146a501aeb1423141e

URL: 
https://github.com/llvm/llvm-project/commit/1edbbf9d20d9f859f7ff2a146a501aeb1423141e
DIFF: 
https://github.com/llvm/llvm-project/commit/1edbbf9d20d9f859f7ff2a146a501aeb1423141e.diff

LOG: [clangd] Log warning when using legacy (theia) semantic highlighting.

The legacy protocol will be removed on trunk after the 12 branch cut,
and gone in clangd 13.

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

(cherry picked from commit 29472bb76915c4929aecc938300f6df31f63ac29)

Added: 


Modified: 
clang-tools-extra/clangd/ClangdLSPServer.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp 
b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index dc89ebd59fe2..35aed2166f03 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -510,6 +510,11 @@ void ClangdLSPServer::onInitialize(const InitializeParams 
&Params,
 "semanticTokens request, choosing the latter (no notifications).");
 Opts.TheiaSemanticHighlighting = false;
   }
+  if (Opts.TheiaSemanticHighlighting) {
+log("Using legacy semanticHighlights notification, which will be removed "
+"in clangd 13. Clients should use the standard semanticTokens "
+"request instead.");
+  }
 
   if (Params.rootUri && *Params.rootUri)
 Opts.WorkspaceRoot = std::string(Params.rootUri->file());



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


[llvm-branch-commits] [openmp] 074ad6d - [OpenMP] libomp: fix build by cl with vs2019

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: AndreyChurbanov
Date: 2021-01-29T21:59:44-08:00
New Revision: 074ad6de6fae20ff7ff720f79df1d6c1a7845157

URL: 
https://github.com/llvm/llvm-project/commit/074ad6de6fae20ff7ff720f79df1d6c1a7845157
DIFF: 
https://github.com/llvm/llvm-project/commit/074ad6de6fae20ff7ff720f79df1d6c1a7845157.diff

LOG: [OpenMP] libomp: fix build by cl with vs2019

Replace VLA with dynamic allocation using alloca().
This fixes https://bugs.llvm.org/show_bug.cgi?id=48919.

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

(cherry picked from commit 7f5ad0e07162e0c19e569986ee37a17c147c9a27)

Added: 


Modified: 
openmp/runtime/src/kmp_settings.cpp

Removed: 




diff  --git a/openmp/runtime/src/kmp_settings.cpp 
b/openmp/runtime/src/kmp_settings.cpp
index a8522130f972..b477edbbfb42 100644
--- a/openmp/runtime/src/kmp_settings.cpp
+++ b/openmp/runtime/src/kmp_settings.cpp
@@ -3355,7 +3355,8 @@ static void __kmp_stg_parse_allocator(char const *name, 
char const *value,
 ntraits++;
 }
   }
-  omp_alloctrait_t traits[ntraits];
+  omp_alloctrait_t *traits =
+  (omp_alloctrait_t *)KMP_ALLOCA(ntraits * sizeof(omp_alloctrait_t));
 
 // Helper macros
 #define IS_POWER_OF_TWO(n) (((n) & ((n)-1)) == 0)



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


[llvm-branch-commits] [clang-tools-extra] 61e05d1 - [clangd] Parse Diagnostics block, and nest ClangTidy block under it.

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Sam McCall
Date: 2021-01-29T21:57:17-08:00
New Revision: 61e05d1bc1af737c5f24fd5cd765f1a9914cbd13

URL: 
https://github.com/llvm/llvm-project/commit/61e05d1bc1af737c5f24fd5cd765f1a9914cbd13
DIFF: 
https://github.com/llvm/llvm-project/commit/61e05d1bc1af737c5f24fd5cd765f1a9914cbd13.diff

LOG: [clangd] Parse Diagnostics block, and nest ClangTidy block under it.

(ClangTidy configuration block hasn't been in any release, so we should be OK
to move it around like this)

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

(cherry picked from commit c3df9d58c75e0f89ca95e947804d65e79a491adc)

Added: 


Modified: 
clang-tools-extra/clangd/Config.h
clang-tools-extra/clangd/ConfigCompile.cpp
clang-tools-extra/clangd/ConfigFragment.h
clang-tools-extra/clangd/ConfigYAML.cpp
clang-tools-extra/clangd/TidyProvider.cpp
clang-tools-extra/clangd/unittests/ConfigCompileTests.cpp
clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp

Removed: 




diff  --git a/clang-tools-extra/clangd/Config.h 
b/clang-tools-extra/clangd/Config.h
index 44ca283b6a0e..391632cb086a 100644
--- a/clang-tools-extra/clangd/Config.h
+++ b/clang-tools-extra/clangd/Config.h
@@ -90,6 +90,13 @@ struct Config {
   struct {
 bool SuppressAll = false;
 llvm::StringSet<> Suppress;
+
+/// Configures what clang-tidy checks to run and options to use with them.
+struct {
+  // A comma-seperated list of globs specify which clang-tidy checks to 
run.
+  std::string Checks;
+  llvm::StringMap CheckOptions;
+} ClangTidy;
   } Diagnostics;
 
   /// Style of the codebase.
@@ -99,14 +106,6 @@ struct Config {
 // ::). All nested namespaces are affected as well.
 std::vector FullyQualifiedNamespaces;
   } Style;
-
-  /// Configures what clang-tidy checks to run and options to use with them.
-  struct {
-// A comma-seperated list of globs to specify which clang-tidy checks to
-// run.
-std::string Checks;
-llvm::StringMap CheckOptions;
-  } ClangTidy;
 };
 
 } // namespace clangd

diff  --git a/clang-tools-extra/clangd/ConfigCompile.cpp 
b/clang-tools-extra/clangd/ConfigCompile.cpp
index e82c6e159421..8682cae36f26 100644
--- a/clang-tools-extra/clangd/ConfigCompile.cpp
+++ b/clang-tools-extra/clangd/ConfigCompile.cpp
@@ -189,7 +189,6 @@ struct FragmentCompiler {
 compile(std::move(F.CompileFlags));
 compile(std::move(F.Index));
 compile(std::move(F.Diagnostics));
-compile(std::move(F.ClangTidy));
   }
 
   void compile(Fragment::IfBlock &&F) {
@@ -379,6 +378,8 @@ struct FragmentCompiler {
 for (llvm::StringRef N : Normalized)
   C.Diagnostics.Suppress.insert(N);
   });
+
+compile(std::move(F.ClangTidy));
   }
 
   void compile(Fragment::StyleBlock &&F) {
@@ -422,7 +423,7 @@ struct FragmentCompiler {
 CurSpec += Str;
   }
 
-  void compile(Fragment::ClangTidyBlock &&F) {
+  void compile(Fragment::DiagnosticsBlock::ClangTidyBlock &&F) {
 std::string Checks;
 for (auto &CheckGlob : F.Add)
   appendTidyCheckSpec(Checks, CheckGlob, true);
@@ -433,8 +434,9 @@ struct FragmentCompiler {
 if (!Checks.empty())
   Out.Apply.push_back(
   [Checks = std::move(Checks)](const Params &, Config &C) {
-C.ClangTidy.Checks.append(
-Checks, C.ClangTidy.Checks.empty() ? /*skip comma*/ 1 : 0,
+C.Diagnostics.ClangTidy.Checks.append(
+Checks,
+C.Diagnostics.ClangTidy.Checks.empty() ? /*skip comma*/ 1 : 0,
 std::string::npos);
   });
 if (!F.CheckOptions.empty()) {
@@ -445,8 +447,8 @@ struct FragmentCompiler {
   Out.Apply.push_back(
   [CheckOptions = std::move(CheckOptions)](const Params &, Config &C) {
 for (auto &StringPair : CheckOptions)
-  C.ClangTidy.CheckOptions.insert_or_assign(StringPair.first,
-StringPair.second);
+  C.Diagnostics.ClangTidy.CheckOptions.insert_or_assign(
+  StringPair.first, StringPair.second);
   });
 }
   }

diff  --git a/clang-tools-extra/clangd/ConfigFragment.h 
b/clang-tools-extra/clangd/ConfigFragment.h
index 5b67c49fe154..c36b07f5e8e2 100644
--- a/clang-tools-extra/clangd/ConfigFragment.h
+++ b/clang-tools-extra/clangd/ConfigFragment.h
@@ -203,6 +203,29 @@ struct Fragment {
 /// (e.g. by disabling a clang-tidy check, or the -Wunused compile flag).
 /// This often has other advantages, such as skipping some analysis.
 std::vector> Suppress;
+
+/// Controls how clang-tidy will run over the code base.
+///
+/// The settings are merged with any settings found in .clang-tidy
+/// configiration files with these ones taking precedence.
+struct ClangTidyBlock {
+  std::vector> Add;
+  /// List of checks to disable.
+  /// Takes precedence over A

[llvm-branch-commits] [clang] 99f43f5 - Relax test expectations in debug-info-gline-tables-only-codeview.cpp

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Hans Wennborg
Date: 2021-01-29T22:00:29-08:00
New Revision: 99f43f598907a9cc1a613c691ffbce7c8bd4ec75

URL: 
https://github.com/llvm/llvm-project/commit/99f43f598907a9cc1a613c691ffbce7c8bd4ec75
DIFF: 
https://github.com/llvm/llvm-project/commit/99f43f598907a9cc1a613c691ffbce7c8bd4ec75.diff

LOG: Relax test expectations in debug-info-gline-tables-only-codeview.cpp

To make it pass also on 32-bit Windows, see PR48920.

(cherry picked from commit 0024efc69ea6cd0b630cd11cef5991b7edb73ffc)

Added: 


Modified: 
clang/test/CodeGenCXX/debug-info-gline-tables-only-codeview.cpp

Removed: 




diff  --git a/clang/test/CodeGenCXX/debug-info-gline-tables-only-codeview.cpp 
b/clang/test/CodeGenCXX/debug-info-gline-tables-only-codeview.cpp
index 27ac682c10f5..409b62da62c1 100644
--- a/clang/test/CodeGenCXX/debug-info-gline-tables-only-codeview.cpp
+++ b/clang/test/CodeGenCXX/debug-info-gline-tables-only-codeview.cpp
@@ -25,6 +25,6 @@ void test() {
   // CHECK: ![[C]] = !DICompositeType(tag: DW_TAG_structure_type, name: "C",
   // CHECK-SAME:  flags: DIFlagFwdDecl
   // CHECK-NOT: identifier
-  // CHECK: ![[MTYPE]] = !DISubroutineType(types: !{{.*}})
+  // CHECK: ![[MTYPE]] = !DISubroutineType({{.*}}types: !{{.*}})
   c.m();
 }



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


[llvm-branch-commits] [llvm] c5a1eb9 - [AMDGPU] Avoid an illegal operand in si-shrink-instructions

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Piotr Sobczak
Date: 2021-01-29T22:02:02-08:00
New Revision: c5a1eb9b0a76eef7e3025b7333a0d256b8562360

URL: 
https://github.com/llvm/llvm-project/commit/c5a1eb9b0a76eef7e3025b7333a0d256b8562360
DIFF: 
https://github.com/llvm/llvm-project/commit/c5a1eb9b0a76eef7e3025b7333a0d256b8562360.diff

LOG: [AMDGPU] Avoid an illegal operand in si-shrink-instructions

Before the patch it was possible to trigger a constant bus
violation when folding immediates into a shrunk instruction.

The patch adds a check to enforce the legality of the new operand.

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

(cherry picked from commit fc8e7411218c846386650cfba111b62827c71da0)

Added: 
llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir

Modified: 
llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp

Removed: 




diff  --git a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp 
b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
index 2628070f219c..cdb78aae1c4f 100644
--- a/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
+++ b/llvm/lib/Target/AMDGPU/SIShrinkInstructions.cpp
@@ -75,17 +75,19 @@ static bool foldImmediates(MachineInstr &MI, const 
SIInstrInfo *TII,
 MachineOperand &MovSrc = Def->getOperand(1);
 bool ConstantFolded = false;
 
-if (MovSrc.isImm() && (isInt<32>(MovSrc.getImm()) ||
-   isUInt<32>(MovSrc.getImm( {
-  Src0.ChangeToImmediate(MovSrc.getImm());
-  ConstantFolded = true;
-} else if (MovSrc.isFI()) {
-  Src0.ChangeToFrameIndex(MovSrc.getIndex());
-  ConstantFolded = true;
-} else if (MovSrc.isGlobal()) {
-  Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(),
-  MovSrc.getTargetFlags());
-  ConstantFolded = true;
+if (TII->isOperandLegal(MI, Src0Idx, &MovSrc)) {
+  if (MovSrc.isImm() &&
+  (isInt<32>(MovSrc.getImm()) || isUInt<32>(MovSrc.getImm( {
+Src0.ChangeToImmediate(MovSrc.getImm());
+ConstantFolded = true;
+  } else if (MovSrc.isFI()) {
+Src0.ChangeToFrameIndex(MovSrc.getIndex());
+ConstantFolded = true;
+  } else if (MovSrc.isGlobal()) {
+Src0.ChangeToGA(MovSrc.getGlobal(), MovSrc.getOffset(),
+MovSrc.getTargetFlags());
+ConstantFolded = true;
+  }
 }
 
 if (ConstantFolded) {

diff  --git a/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir 
b/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir
new file mode 100644
index ..7889f437facf
--- /dev/null
+++ b/llvm/test/CodeGen/AMDGPU/shrink-instructions-illegal-fold.mir
@@ -0,0 +1,23 @@
+# RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=si-shrink-instructions 
--verify-machineinstrs %s -o - | FileCheck %s
+
+# Make sure immediate folding into V_CNDMASK respects constant bus 
restrictions.
+---
+
+name:shrink_cndmask_illegal_imm_folding
+tracksRegLiveness: true
+body: |
+  bb.0:
+liveins: $vgpr0, $vgpr1
+; CHECK-LABEL: name: shrink_cndmask_illegal_imm_folding
+; CHECK: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
+; CHECK: [[MOV:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec
+; CHECK: V_CMP_EQ_U32_e32 0, [[COPY]], implicit-def $vcc, implicit $exec
+; CHECK: V_CNDMASK_B32_e32 [[MOV]], killed [[COPY]], implicit $vcc, 
implicit $exec
+
+%0:vgpr_32 = COPY $vgpr0
+%1:vgpr_32 = V_MOV_B32_e32 32768, implicit $exec
+V_CMP_EQ_U32_e32 0, %0:vgpr_32, implicit-def $vcc, implicit $exec
+%2:vgpr_32 = V_CNDMASK_B32_e64 0, %1:vgpr_32, 0, killed %0:vgpr_32, $vcc, 
implicit $exec
+S_NOP 0
+
+...



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


[llvm-branch-commits] [compiler-rt] b2710e7 - [sanitizer] Fix msan test build on FreeBSD after 7afdc89c2054

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Dimitry Andric
Date: 2021-01-29T22:03:14-08:00
New Revision: b2710e7535bd43d9fd6f9792644fe2c207079c42

URL: 
https://github.com/llvm/llvm-project/commit/b2710e7535bd43d9fd6f9792644fe2c207079c42
DIFF: 
https://github.com/llvm/llvm-project/commit/b2710e7535bd43d9fd6f9792644fe2c207079c42.diff

LOG: [sanitizer] Fix msan test build on FreeBSD after 7afdc89c2054

This commit accidentally enabled fgetgrent_r() in the msan tests under
FreeBSD, but this function is not supported. Also remove FreeBSD from
the SANITIZER_INTERCEPT_FGETGRENT_R macro.

(cherry picked from commit e056fc6cb676f72d5b7dfe7ca540b3275bd1a46f)

Added: 


Modified: 
compiler-rt/lib/msan/tests/msan_test.cpp
compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h

Removed: 




diff  --git a/compiler-rt/lib/msan/tests/msan_test.cpp 
b/compiler-rt/lib/msan/tests/msan_test.cpp
index 7378b237a711..5dc9090f36c0 100644
--- a/compiler-rt/lib/msan/tests/msan_test.cpp
+++ b/compiler-rt/lib/msan/tests/msan_test.cpp
@@ -3707,7 +3707,9 @@ TEST(MemorySanitizer, getgrent_r) {
   EXPECT_NOT_POISONED(grp.gr_gid);
   EXPECT_NOT_POISONED(grpres);
 }
+#endif
 
+#ifdef __GLIBC__
 TEST(MemorySanitizer, fgetgrent_r) {
   FILE *fp = fopen("/etc/group", "r");
   struct group grp;

diff  --git 
a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h 
b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index 7f7b38d4215b..068fc9829e57 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -226,7 +226,7 @@
   (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
 #define SANITIZER_INTERCEPT_GETPWENT \
   (SI_FREEBSD || SI_NETBSD || SI_MAC || SI_LINUX_NOT_ANDROID || SI_SOLARIS)
-#define SANITIZER_INTERCEPT_FGETGRENT_R (SI_FREEBSD || SI_GLIBC || SI_SOLARIS)
+#define SANITIZER_INTERCEPT_FGETGRENT_R (SI_GLIBC || SI_SOLARIS)
 #define SANITIZER_INTERCEPT_FGETPWENT SI_LINUX_NOT_ANDROID || SI_SOLARIS
 #define SANITIZER_INTERCEPT_GETPWENT_R \
   (SI_FREEBSD || SI_NETBSD || SI_GLIBC || SI_SOLARIS)



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


[llvm-branch-commits] [clang] 4e20d9c - Make the profile-filter.c test compatible with 32-bit systems

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Petr Hosek
Date: 2021-01-29T22:05:41-08:00
New Revision: 4e20d9c03d9acc9ee5a78cbba82b08d51ecbaf3f

URL: 
https://github.com/llvm/llvm-project/commit/4e20d9c03d9acc9ee5a78cbba82b08d51ecbaf3f
DIFF: 
https://github.com/llvm/llvm-project/commit/4e20d9c03d9acc9ee5a78cbba82b08d51ecbaf3f.diff

LOG: Make the profile-filter.c test compatible with 32-bit systems

This addresses PR48930.

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

(cherry picked from commit 0217f1c7a31ba44715bc083a60cddc2192ffed96)

Added: 


Modified: 
clang/test/CodeGen/profile-filter.c

Removed: 




diff  --git a/clang/test/CodeGen/profile-filter.c 
b/clang/test/CodeGen/profile-filter.c
index 5415ff96cb14..dc5a31e872a1 100644
--- a/clang/test/CodeGen/profile-filter.c
+++ b/clang/test/CodeGen/profile-filter.c
@@ -28,11 +28,11 @@ unsigned i;
 // EXCLUDE: noprofile
 // EXCLUDE: @test1
 unsigned test1() {
-  // CHECK: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test1, i64 0, i64 0), align 8
-  // FUNC: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test1, i64 0, i64 0), align 8
-  // FILE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test1, i64 0, i64 0), align 8
-  // SECTION-NOT: %pgocount = load i64, i64* getelementptr inbounds ([1 x 
i64], [1 x i64]* @__profc_test1, i64 0, i64 0), align 8
-  // EXCLUDE-NOT: %pgocount = load i64, i64* getelementptr inbounds ([1 x 
i64], [1 x i64]* @__profc_test1, i64 0, i64 0), align 8
+  // CHECK: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test1, i64 0, i64 0)
+  // FUNC: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test1, i64 0, i64 0)
+  // FILE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test1, i64 0, i64 0)
+  // SECTION-NOT: %pgocount = load i64, i64* getelementptr inbounds ([1 x 
i64], [1 x i64]* @__profc_test1, i64 0, i64 0)
+  // EXCLUDE-NOT: %pgocount = load i64, i64* getelementptr inbounds ([1 x 
i64], [1 x i64]* @__profc_test1, i64 0, i64 0)
   return i + 1;
 }
 
@@ -47,10 +47,10 @@ unsigned test1() {
 // EXCLUDE-NOT: noprofile
 // EXCLUDE: @test2
 unsigned test2() {
-  // CHECK: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test2, i64 0, i64 0), align 8
-  // FUNC-NOT: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], 
[1 x i64]* @__profc_test2, i64 0, i64 0), align 8
-  // FILE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test2, i64 0, i64 0), align 8
-  // SECTION: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 
x i64]* @__profc_test2, i64 0, i64 0), align 8
-  // EXCLUDE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 
x i64]* @__profc_test2, i64 0, i64 0), align 8
+  // CHECK: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test2, i64 0, i64 0)
+  // FUNC-NOT: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], 
[1 x i64]* @__profc_test2, i64 0, i64 0)
+  // FILE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x 
i64]* @__profc_test2, i64 0, i64 0)
+  // SECTION: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 
x i64]* @__profc_test2, i64 0, i64 0)
+  // EXCLUDE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 
x i64]* @__profc_test2, i64 0, i64 0)
   return i - 1;
 }



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


[llvm-branch-commits] [openmp] f54cf61 - [OpenMP][NVPTX] Disable building NVPTX deviceRTL by default on a non-CUDA system

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Shilei Tian
Date: 2021-01-29T22:11:31-08:00
New Revision: f54cf61ad8e1cc6592074ddd7ad07908623ead6b

URL: 
https://github.com/llvm/llvm-project/commit/f54cf61ad8e1cc6592074ddd7ad07908623ead6b
DIFF: 
https://github.com/llvm/llvm-project/commit/f54cf61ad8e1cc6592074ddd7ad07908623ead6b.diff

LOG: [OpenMP][NVPTX] Disable building NVPTX deviceRTL by default on a non-CUDA 
system

D95466 dropped CUDA to build NVPTX deviceRTL and enabled it by default.
However, the building requires some libraries that are not available on non-CUDA
system by default, which could break the compilation. This patch disabled the
build by default. It can be enabled with `LIBOMPTARGET_BUILD_NVPTX_BCLIB=ON`.

Reviewed By: kparzysz

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

(cherry picked from commit fb12df4a8e33d759938057718273dfb434b2d9c4)

Added: 


Modified: 
openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt

Removed: 




diff  --git a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt 
b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
index 4661bf08af1c..23efbba29d66 100644
--- a/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
+++ b/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt
@@ -10,6 +10,15 @@
 #
 
##===--===##
 
+# By default we will not build NVPTX deviceRTL on a non-CUDA
+set(LIBOMPTARGET_BUILD_NVPTX_BCLIB FALSE CACHE BOOL
+  "Whether build NVPTX deviceRTL on non-CUDA system.")
+
+if (NOT (LIBOMPTARGET_DEP_CUDA_FOUND OR LIBOMPTARGET_BUILD_NVPTX_BCLIB))
+  libomptarget_say("Not building NVPTX deviceRTL by default on non-CUDA 
system.")
+  return()
+endif()
+
 # Check if we can create an LLVM bitcode implementation of the runtime library
 # that could be inlined in the user application. For that we need to find
 # a Clang compiler capable of compiling our CUDA files to LLVM bitcode and



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


[llvm-branch-commits] [clang-tools-extra] 07f8d43 - [clang-tidy] Fix linking tests to LLVMTestingSupport

2021-01-29 Thread Tom Stellard via llvm-branch-commits

Author: Michał Górny
Date: 2021-01-29T22:06:51-08:00
New Revision: 07f8d437134c0b229104241a621db05013da0049

URL: 
https://github.com/llvm/llvm-project/commit/07f8d437134c0b229104241a621db05013da0049
DIFF: 
https://github.com/llvm/llvm-project/commit/07f8d437134c0b229104241a621db05013da0049.diff

LOG: [clang-tidy] Fix linking tests to LLVMTestingSupport

LLVMTestingSupport is not part of libLLVM, and therefore can not
be linked to via LLVM_LINK_COMPONENTS.  Instead, it needs to be
specified explicitly to ensure that it is linked explicitly
even if LLVM_LINK_LLVM_DYLIB is used.  This is consistent with handling
in clangd.

Fixes PR#48931

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

(cherry picked from commit 632545e8ce846ccaeca8df15a3dc5e36d01a1275)

Added: 


Modified: 
clang-tools-extra/unittests/clang-tidy/CMakeLists.txt

Removed: 




diff  --git a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt 
b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
index be35b71d15cf..05d330dd8033 100644
--- a/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
+++ b/clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
@@ -1,7 +1,6 @@
 set(LLVM_LINK_COMPONENTS
   FrontendOpenMP
   Support
-  TestingSupport
   )
 
 get_filename_component(CLANG_LINT_SOURCE_DIR
@@ -46,4 +45,5 @@ target_link_libraries(ClangTidyTests
   clangTidyObjCModule
   clangTidyReadabilityModule
   clangTidyUtils
+  LLVMTestingSupport
   )



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