[clang] 4a687ef - [clang testing] Unbreak read-only source builds

2022-10-18 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2022-10-18T12:47:12-04:00
New Revision: 4a687efecb825f8c1c3e10ffc7949f4b2cd3c1bd

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

LOG: [clang testing] Unbreak read-only source builds

Added: 


Modified: 
clang/test/Sema/builtins-arm64-mte.c

Removed: 




diff  --git a/clang/test/Sema/builtins-arm64-mte.c 
b/clang/test/Sema/builtins-arm64-mte.c
index 11787cf55fdb4..49db0484a101d 100644
--- a/clang/test/Sema/builtins-arm64-mte.c
+++ b/clang/test/Sema/builtins-arm64-mte.c
@@ -1,6 +1,6 @@
 // RUN: %clang_cc1 -triple arm64-arm-eabi %s -target-feature +mte 
-fsyntax-only -verify
 // RUN: %clang_cc1 -triple arm64-arm-eabi %s -target-feature +mte -x c++ 
-fsyntax-only -verify
-// RUN: %clang_cc1 -triple arm64-arm-eabi %s -DNO_MTE -x c++ -S -emit-llvm  
-verify
+// RUN: %clang_cc1 -triple arm64-arm-eabi %s -DNO_MTE -x c++ -S -emit-llvm 
-verify -o -
 #include 
 #include 
 



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


[clang] 3eb2be6 - Unbreak no-asserts testing

2021-04-29 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2021-04-29T10:01:37-04:00
New Revision: 3eb2be67b997ea62f47dbe90a62e828ecfb266a8

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

LOG: Unbreak no-asserts testing

Added: 


Modified: 
clang/test/Driver/debug-pass-structure.c

Removed: 




diff  --git a/clang/test/Driver/debug-pass-structure.c 
b/clang/test/Driver/debug-pass-structure.c
index 7e1d748ad847..30283249f412 100644
--- a/clang/test/Driver/debug-pass-structure.c
+++ b/clang/test/Driver/debug-pass-structure.c
@@ -1,6 +1,7 @@
 // Test that we print pass structure with new and legacy PM.
 // RUN: %clang -fexperimental-new-pass-manager -fdebug-pass-structure -O3 -S 
-emit-llvm %s -o /dev/null 2>&1 | FileCheck %s --check-prefix=NEWPM
 // RUN: %clang -flegacy-pass-manager -fdebug-pass-structure -O0 -S -emit-llvm 
%s -o /dev/null 2>&1 | FileCheck %s --check-prefix=LEGACYPM
+// REQUIRES: asserts
 
 // NEWPM: Annotation2MetadataPass on [module]
 // NEWPM-NEXT: ForceFunctionAttrsPass on [module]



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


[clang] 243333e - Revert "[Driver] Drop obsoleted Ubuntu 11.04 gcc detection"

2021-03-20 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2021-03-20T07:29:01-04:00
New Revision: 24ef3ec6c1e3910eb442177c2e2e927e6a87

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

LOG: Revert "[Driver] Drop obsoleted Ubuntu 11.04 gcc detection"

This reverts commit bdf39e6b0ed4b41a1842ac0193f30a726f8d9f63.

The change is failing on Fedora 33 (x86-64).

Added: 


Modified: 
clang/lib/Driver/ToolChains/Gnu.cpp
clang/test/Driver/gcc-toolchain.cpp
clang/test/Driver/linux-header-search.cpp
clang/test/Driver/linux-ld.c

Removed: 




diff  --git a/clang/lib/Driver/ToolChains/Gnu.cpp 
b/clang/lib/Driver/ToolChains/Gnu.cpp
index 3491a29a5f9c..3c1fc87d7896 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2506,6 +2506,7 @@ void 
Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
 const llvm::Triple , const ArgList ,
 const std::string , StringRef CandidateTriple,
 bool NeedsBiarchSuffix, bool GCCDirExists, bool GCCCrossDirExists) {
+  llvm::Triple::ArchType TargetArch = TargetTriple.getArch();
   // Locations relative to the system lib directory where GCC's triple-specific
   // directories might reside.
   struct GCCLibSuffix {
@@ -2529,7 +2530,15 @@ void 
Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(
   // files in that location, not just GCC installation data.
   {CandidateTriple.str(), "..",
TargetTriple.getVendor() == llvm::Triple::Freescale ||
-   TargetTriple.getVendor() == llvm::Triple::OpenEmbedded}};
+   TargetTriple.getVendor() == llvm::Triple::OpenEmbedded},
+
+  // Deal with cases (on Ubuntu) where the system architecture could be 
i386
+  // but the GCC target architecture could be (say) i686.
+  // FIXME: It may be worthwhile to generalize this and look for a second
+  // triple.
+  {"i386-linux-gnu/gcc/" + CandidateTriple.str(), "../../..",
+   (TargetArch == llvm::Triple::x86 &&
+TargetTriple.getOS() != llvm::Triple::Solaris)}};
 
   for (auto  : Suffixes) {
 if (!Suffix.Active)

diff  --git a/clang/test/Driver/gcc-toolchain.cpp 
b/clang/test/Driver/gcc-toolchain.cpp
index 03a7991d6c70..cddf9b1bdbca 100644
--- a/clang/test/Driver/gcc-toolchain.cpp
+++ b/clang/test/Driver/gcc-toolchain.cpp
@@ -1,31 +1,34 @@
 // Test that gcc-toolchain option is working correctly
 //
 // RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
-// RUN:   --target=x86_64-linux-gnu 
--gcc-toolchain=%S/Inputs/ubuntu_14.04_multiarch_tree/usr | \
-// RUN:   FileCheck %s
+// RUN: --target=i386-unknown-linux -stdlib=libstdc++ \
+// RUN: --gcc-toolchain=%S/Inputs/ubuntu_11.04_multiarch_tree/usr \
+// RUN: --sysroot="" \
+// RUN:   | FileCheck %s
 //
 // Additionally check that the legacy spelling of the flag works.
 // RUN: %clangxx -no-canonical-prefixes %s -### -o %t 2>&1 \
-// RUN:   --target=x86_64-linux-gnu -gcc-toolchain 
%S/Inputs/ubuntu_14.04_multiarch_tree/usr | \
-// RUN:   FileCheck %s
+// RUN: --target=i386-unknown-linux -stdlib=libstdc++ \
+// RUN: -gcc-toolchain %S/Inputs/ubuntu_11.04_multiarch_tree/usr \
+// RUN: --sysroot="" \
+// RUN:   | FileCheck %s
 //
 // Test for header search toolchain detection.
 // CHECK: "-internal-isystem"
-// CHECK: 
"[[TOOLCHAIN:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8"
+// CHECK: 
"[[TOOLCHAIN:[^"]+]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5"
 // CHECK: "-internal-isystem"
-// CHECK: 
"[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8"
+// CHECK: 
"[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/i686-linux-gnu"
 // CHECK: "-internal-isystem"
-// CHECK: 
"[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward"
+// CHECK: 
"[[TOOLCHAIN]]/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/../../../../../include/c++/4.5/backward"
 // CHECK: "-internal-isystem" "/usr/local/include"
 //
 // Test for linker toolchain detection. Note that only the '-L' flags will use
 // the same precise formatting of the path as the '-internal-system' flags
 // above, so we just blanket wildcard match the 'crtbegin.o'.
 // CHECK: "{{[^"]*}}ld{{(.exe)?}}"
-// CHECK-SAME: "{{[^"]*}}/usr/lib/gcc/x86_64-linux-gnu/4.8{{/|}}crtbegin.o"
-// CHECK-SAME: "-L[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8"
-/// On x86_64, there is an extra 
usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu but we should not 
test it.
-// CHECK-SAME: "-L[[TOOLCHAIN]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
+// CHECK: 
"{{[^"]*}}/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5{{/|}}crtbegin.o"
+// CHECK: 

Re: [clang] bdf39e6 - [Driver] Drop obsoleted Ubuntu 11.04 gcc detection

2021-03-20 Thread David Zarzycki via cfe-commits
This is failing on my Fedora 33 (x6-64) box. I'm going to revert this. If you 
need help debugging this, please let me know. Here is the relevant info:



FAIL: Clang :: Driver/gcc-toolchain.cpp (6552 of 75252)
 TEST 'Clang :: Driver/gcc-toolchain.cpp' FAILED 

Script:
--
: 'RUN: at line 3';   /tmp/_update_lc/r/bin/clang --driver-mode=g++ 
-no-canonical-prefixes /home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp 
-### -o /tmp/_update_lc/r/tools/clang/test/Driver/Output/gcc-toolchain.cpp.tmp 
2>&1--target=x86_64-linux-gnu 
--gcc-toolchain=/home/dave/ro_s/lp/clang/test/Driver/Inputs/ubuntu_14.04_multiarch_tree/usr
 |/tmp/_update_lc/r/bin/FileCheck 
/home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp
: 'RUN: at line 8';   /tmp/_update_lc/r/bin/clang --driver-mode=g++ 
-no-canonical-prefixes /home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp 
-### -o /tmp/_update_lc/r/tools/clang/test/Driver/Output/gcc-toolchain.cpp.tmp 
2>&1--target=x86_64-linux-gnu -gcc-toolchain 
/home/dave/ro_s/lp/clang/test/Driver/Inputs/ubuntu_14.04_multiarch_tree/usr |   
 /tmp/_update_lc/r/bin/FileCheck 
/home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp
: 'RUN: at line 30';   /tmp/_update_lc/r/bin/clang --driver-mode=g++ 
-no-canonical-prefixes /home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp 
-### -o /tmp/_update_lc/r/tools/clang/test/Driver/Output/gcc-toolchain.cpp.tmp 
2>&1--target=aarch64-suse-linux 
--gcc-toolchain=/home/dave/ro_s/lp/clang/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr
 |/tmp/_update_lc/r/bin/FileCheck 
/home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp --check-prefix=AARCH64
: 'RUN: at line 33';   /tmp/_update_lc/r/bin/clang --driver-mode=g++ 
-no-canonical-prefixes /home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp 
-### -o /tmp/_update_lc/r/tools/clang/test/Driver/Output/gcc-toolchain.cpp.tmp 
2>&1--target=aarch64-suse-linux 
-B/home/dave/ro_s/lp/clang/test/Driver/Inputs/opensuse_42.2_aarch64_tree/usr |  
  /tmp/_update_lc/r/bin/FileCheck 
/home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp --check-prefix=NO_AARCH64
--
Exit Code: 1

Command Output (stderr):
--
/home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp:14:11: error: CHECK: 
expected string not found in input
// CHECK: 
"[[TOOLCHAIN:[^"]+]]/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8"
  ^
:5:568: note: scanning from here
 "/tmp/_update_lc/r/bin/clang" "-cc1" "-triple" "x86_64-unknown-linux-gnu" 
"-emit-obj" "-mrelax-all" "--mrelax-relocations" "-disable-free" 
"-disable-llvm-verifier" "-discard-value-names" "-main-file-name" 
"gcc-toolchain.cpp" "-mrelocation-model" "static" "-mframe-pointer=all" 
"-fmath-errno" "-fno-rounding-math" "-mconstructor-aliases" "-munwind-tables" 
"-target-cpu" "x86-64" "-tune-cpu" "generic" "-debugger-tuning=gdb" 
"-fcoverage-compilation-dir=/tmp/_update_lc/r/tools/clang/test/Driver" 
"-resource-dir" "/tmp/_update_lc/r/lib/clang/13.0.0" "-internal-isystem" 
"/tmp/_update_lc/r/bin/../include/c++/v1" "-internal-isystem" 
"/usr/local/include" "-internal-isystem" 
"/tmp/_update_lc/r/lib/clang/13.0.0/include" "-internal-externc-isystem" 
"/include" "-internal-externc-isystem" "/usr/include" "-fdeprecated-macro" 
"-fdebug-compilation-dir=/tmp/_update_lc/r/tools/clang/test/Driver" 
"-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fcxx-exceptions" "-fexceptions" 
"-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o" "/tmp/gcc-toolchain-dfa1a3.o" 
"-x" "c++" "/home/dave/ro_s/lp/clang/test/Driver/gcc-toolchain.cpp"







   ^
:6:590: note: possible intended match here
 "/tmp/_update_lc/r/bin/ld.lld" "--hash-style=gnu" "--eh-frame-hdr" "-m" 
"elf_x86_64" "-dynamic-linker" "/lib64/ld-linux-x86-64.so.2" "-o" 
"/tmp/_update_lc/r/tools/clang/test/Driver/Output/gcc-toolchain.cpp.tmp" 
"/lib/../lib64/crt1.o" "/lib/../lib64/crti.o" 
"/home/dave/ro_s/lp/clang/test/Driver/Inputs/ubuntu_14.04_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/4.8/crtbegin.o"
 
"-L/home/dave/ro_s/lp/clang/test/Driver/Inputs/ubuntu_14.04_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/4.8"
 "-L/lib/../lib64" "-L/usr/lib/../lib64" 
"-L/home/dave/ro_s/lp/clang/test/Driver/Inputs/ubuntu_14.04_multiarch_tree/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.."
 "-L/tmp/_update_lc/r/bin/../lib" "-L/lib" "-L/usr/lib" 
"/tmp/gcc-toolchain-dfa1a3.o" "-lc++" "-lm" "-lgcc_s" "-lgcc" "-lc" "-lgcc_s" 
"-lgcc" "crtend.o" 

[clang] 87f6de7 - [clang testing] Fix a read-only source build system failure

2020-10-21 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2020-10-21T08:08:03-04:00
New Revision: 87f6de72bcd346bbbf468e9f9a0e9d1bbf0630a9

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

LOG: [clang testing] Fix a read-only source build system failure

Added: 


Modified: 
clang/test/CodeGen/basic-block-sections.c

Removed: 




diff  --git a/clang/test/CodeGen/basic-block-sections.c 
b/clang/test/CodeGen/basic-block-sections.c
index 3d68394bb78e..2eefbbfd21e1 100644
--- a/clang/test/CodeGen/basic-block-sections.c
+++ b/clang/test/CodeGen/basic-block-sections.c
@@ -6,7 +6,7 @@
 // RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all -o - < %s | 
FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_ALL
 // RUN: %clang_cc1 -triple x86_64 -S 
-fbasic-block-sections=list=%S/Inputs/basic-block-sections.funcnames -o - < %s 
| FileCheck %s --check-prefix=BB_WORLD --check-prefix=BB_LIST
 // RUN: %clang_cc1 -triple x86_64 -S -fbasic-block-sections=all 
-funique-basic-block-section-names -o - < %s | FileCheck %s 
--check-prefix=UNIQUE
-// RUN: not %clang_cc1 -fbasic-block-sections=list= -emit-obj %s 2>&1 | 
FileCheck %s --check-prefix=ERROR
+// RUN: not %clang_cc1 -fbasic-block-sections=list= -emit-obj -o - %s 2>&1 | 
FileCheck %s --check-prefix=ERROR
 
 int world(int a) {
   if (a > 10)



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


[clang] dab859d - Reland: [clang driver] Move default module cache from system temporary directory

2020-06-27 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2020-06-27T05:35:15-04:00
New Revision: dab859d1bf250c4d0299ac505e2a6773c56b6503

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

LOG: Reland: [clang driver] Move default module cache from system temporary 
directory

This fixes a unit test. Otherwise here is the original commit:

1) Shared writable directories like /tmp are a security problem.
2) Systems provide dedicated cache directories these days anyway.
3) This also refines LLVM's cache_directory() on Darwin platforms to use
   the Darwin per-user cache directory.

Reviewers: compnerd, aprantl, jakehehrlich, espindola, respindola, 
ilya-biryukov, pcc, sammccall

Reviewed By: compnerd, sammccall

Subscribers: hiraditya, llvm-commits, cfe-commits

Tags: #clang, #llvm

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

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/include/clang/Driver/Driver.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/modules-cache-path.m
clang/unittests/Driver/ModuleCacheTest.cpp
llvm/lib/Support/Unix/Path.inc
llvm/unittests/Support/Path.cpp

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 15e6d35117b4..c24c289f94b4 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -104,6 +104,10 @@ New Compiler Flags
   simplify access to the many single purpose floating point options. The 
default
   setting is ``precise``.
 
+- The default module cache has moved from /tmp to a per-user cache directory.
+  By default, this is ~/.cache but on some platforms or installations, this
+  might be elsewhere. The -fmodules-cache-path=... flag continues to work.
+
 Deprecated Compiler Flags
 -
 

diff  --git a/clang/include/clang/Driver/Driver.h 
b/clang/include/clang/Driver/Driver.h
index b024d6a0d3a3..dc18f1314f81 100644
--- a/clang/include/clang/Driver/Driver.h
+++ b/clang/include/clang/Driver/Driver.h
@@ -621,7 +621,8 @@ class Driver {
   static bool GetReleaseVersion(StringRef Str,
 MutableArrayRef Digits);
   /// Compute the default -fmodule-cache-path.
-  static void getDefaultModuleCachePath(SmallVectorImpl );
+  /// \return True if the system provides a default cache directory.
+  static bool getDefaultModuleCachePath(SmallVectorImpl );
 };
 
 /// \return True if the last defined optimization level is -Ofast.

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 8903641a26c6..1fd638f435b9 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -721,38 +721,6 @@ static void addDashXForInput(const ArgList , const 
InputInfo ,
   }
 }
 
-static void appendUserToPath(SmallVectorImpl ) {
-#ifdef LLVM_ON_UNIX
-  const char *Username = getenv("LOGNAME");
-#else
-  const char *Username = getenv("USERNAME");
-#endif
-  if (Username) {
-// Validate that LoginName can be used in a path, and get its length.
-size_t Len = 0;
-for (const char *P = Username; *P; ++P, ++Len) {
-  if (!clang::isAlphanumeric(*P) && *P != '_') {
-Username = nullptr;
-break;
-  }
-}
-
-if (Username && Len > 0) {
-  Result.append(Username, Username + Len);
-  return;
-}
-  }
-
-// Fallback to user id.
-#ifdef LLVM_ON_UNIX
-  std::string UID = llvm::utostr(getuid());
-#else
-  // FIXME: Windows seems to have an 'SID' that might work.
-  std::string UID = "";
-#endif
-  Result.append(UID.begin(), UID.end());
-}
-
 static void addPGOAndCoverageFlags(const ToolChain , Compilation ,
const Driver , const InputInfo ,
const ArgList ,
@@ -3201,11 +3169,13 @@ static void RenderBuiltinOptions(const ToolChain , 
const llvm::Triple ,
 CmdArgs.push_back("-fno-math-builtin");
 }
 
-void Driver::getDefaultModuleCachePath(SmallVectorImpl ) {
-  llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false, Result);
-  llvm::sys::path::append(Result, "org.llvm.clang.");
-  appendUserToPath(Result);
-  llvm::sys::path::append(Result, "ModuleCache");
+bool Driver::getDefaultModuleCachePath(SmallVectorImpl ) {
+  if (llvm::sys::path::cache_directory(Result)) {
+llvm::sys::path::append(Result, "clang");
+llvm::sys::path::append(Result, "ModuleCache");
+return true;
+  }
+  return false;
 }
 
 static void RenderModulesOptions(Compilation , const Driver ,
@@ -3262,6 +3232,7 @@ static void RenderModulesOptions(Compilation , const 
Driver ,
 if (Arg *A = Args.getLastArg(options::OPT_fmodules_cache_path))
   Path = A->getValue();
 
+bool HasPath = true;
 if (C.isForDiagnostics()) {
   // When generating crash reports, we want 

[clang] bb26838 - [clang driver] Move default module cache from system temporary directory

2020-06-26 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2020-06-26T07:46:03-04:00
New Revision: bb26838ceffb5feaa18186f55f7525a08084899e

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

LOG: [clang driver] Move default module cache from system temporary directory

1) Shared writable directories like /tmp are a security problem.
2) Systems provide dedicated cache directories these days anyway.
3) This also refines LLVM's cache_directory() on Darwin platforms to use
   the Darwin per-user cache directory.

Reviewers: compnerd, aprantl, jakehehrlich, espindola, respindola, 
ilya-biryukov, pcc, sammccall

Reviewed By: compnerd, sammccall

Subscribers: hiraditya, llvm-commits, cfe-commits

Tags: #clang, #llvm

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

Added: 


Modified: 
clang/docs/ReleaseNotes.rst
clang/include/clang/Driver/Driver.h
clang/lib/Driver/ToolChains/Clang.cpp
clang/test/Driver/modules-cache-path.m
clang/unittests/Driver/ModuleCacheTest.cpp
llvm/lib/Support/Unix/Path.inc

Removed: 




diff  --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 15e6d35117b4..c24c289f94b4 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -104,6 +104,10 @@ New Compiler Flags
   simplify access to the many single purpose floating point options. The 
default
   setting is ``precise``.
 
+- The default module cache has moved from /tmp to a per-user cache directory.
+  By default, this is ~/.cache but on some platforms or installations, this
+  might be elsewhere. The -fmodules-cache-path=... flag continues to work.
+
 Deprecated Compiler Flags
 -
 

diff  --git a/clang/include/clang/Driver/Driver.h 
b/clang/include/clang/Driver/Driver.h
index b024d6a0d3a3..dc18f1314f81 100644
--- a/clang/include/clang/Driver/Driver.h
+++ b/clang/include/clang/Driver/Driver.h
@@ -621,7 +621,8 @@ class Driver {
   static bool GetReleaseVersion(StringRef Str,
 MutableArrayRef Digits);
   /// Compute the default -fmodule-cache-path.
-  static void getDefaultModuleCachePath(SmallVectorImpl );
+  /// \return True if the system provides a default cache directory.
+  static bool getDefaultModuleCachePath(SmallVectorImpl );
 };
 
 /// \return True if the last defined optimization level is -Ofast.

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 8903641a26c6..1fd638f435b9 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -721,38 +721,6 @@ static void addDashXForInput(const ArgList , const 
InputInfo ,
   }
 }
 
-static void appendUserToPath(SmallVectorImpl ) {
-#ifdef LLVM_ON_UNIX
-  const char *Username = getenv("LOGNAME");
-#else
-  const char *Username = getenv("USERNAME");
-#endif
-  if (Username) {
-// Validate that LoginName can be used in a path, and get its length.
-size_t Len = 0;
-for (const char *P = Username; *P; ++P, ++Len) {
-  if (!clang::isAlphanumeric(*P) && *P != '_') {
-Username = nullptr;
-break;
-  }
-}
-
-if (Username && Len > 0) {
-  Result.append(Username, Username + Len);
-  return;
-}
-  }
-
-// Fallback to user id.
-#ifdef LLVM_ON_UNIX
-  std::string UID = llvm::utostr(getuid());
-#else
-  // FIXME: Windows seems to have an 'SID' that might work.
-  std::string UID = "";
-#endif
-  Result.append(UID.begin(), UID.end());
-}
-
 static void addPGOAndCoverageFlags(const ToolChain , Compilation ,
const Driver , const InputInfo ,
const ArgList ,
@@ -3201,11 +3169,13 @@ static void RenderBuiltinOptions(const ToolChain , 
const llvm::Triple ,
 CmdArgs.push_back("-fno-math-builtin");
 }
 
-void Driver::getDefaultModuleCachePath(SmallVectorImpl ) {
-  llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false, Result);
-  llvm::sys::path::append(Result, "org.llvm.clang.");
-  appendUserToPath(Result);
-  llvm::sys::path::append(Result, "ModuleCache");
+bool Driver::getDefaultModuleCachePath(SmallVectorImpl ) {
+  if (llvm::sys::path::cache_directory(Result)) {
+llvm::sys::path::append(Result, "clang");
+llvm::sys::path::append(Result, "ModuleCache");
+return true;
+  }
+  return false;
 }
 
 static void RenderModulesOptions(Compilation , const Driver ,
@@ -3262,6 +3232,7 @@ static void RenderModulesOptions(Compilation , const 
Driver ,
 if (Arg *A = Args.getLastArg(options::OPT_fmodules_cache_path))
   Path = A->getValue();
 
+bool HasPath = true;
 if (C.isForDiagnostics()) {
   // When generating crash reports, we want to emit the modules along with
   // the reproduction sources, so we ignore any provided module path.
@@ 

[clang] e717e87 - [libclang] Shared libraries require PIC unless WIN32

2020-04-29 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2020-04-29T11:25:45-04:00
New Revision: e717e8744d374e16603157e5135005727bf17901

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

LOG: [libclang] Shared libraries require PIC unless WIN32

Added: 


Modified: 
clang/tools/libclang/CMakeLists.txt

Removed: 




diff  --git a/clang/tools/libclang/CMakeLists.txt 
b/clang/tools/libclang/CMakeLists.txt
index bb2b14cc8e27..f56771b8a594 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -77,7 +77,7 @@ if(MSVC)
   set(LLVM_EXPORTED_SYMBOL_FILE)
 endif()
 
-if(LLVM_ENABLE_PIC OR NOT LIBCLANG_BUILD_STATIC)
+if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCLANG_BUILD_STATIC))
   set(ENABLE_SHARED SHARED)
 endif()
 



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


Re: [clang] 6654719 - [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC

2020-04-29 Thread David Zarzycki via cfe-commits
Hi Cristian,

That's alright. No worries. Good luck with the move (especially during the 
pandemic). My three stage test of LLVM+clang+lld+libcxx+libcxxabi is almost 
done, and I'll commit your suggested fix soon.

Dave

On Wed, Apr 29, 2020, at 10:53 AM, Cristian Adam wrote:
> Hi, 
> 
> Thank you David for not reverting my 3rd attempt to get libclang to 
> build statically on Windows.
> 
> In my defense the commit landed on a Saturday, and while I usually hack 
> on weekends, but now I'm involved in moving to a new home and I wasn't 
> able to reply to your message.
> 
> I'm sorry for the trouble of getting the revert and failed build. I 
> thought I had everything covered this time...
> 
> Cheers
> Cristian.
> 
> > -Original Message-
> > From: David Zarzycki 
> > Sent: Wednesday, 29 April 2020 16:37
> > To: Hans Wennborg 
> > Cc: Cristian Adam ; David Zarzycki via cfe-commits 
> >  > comm...@lists.llvm.org>; Nico Weber 
> > Subject: Re: [clang] 6654719 - [CMake] Fix logic error: NOT
> > LIBCLANG_BUILD_STATIC does not imply PIC
> > 
> > Okay, sounds good. For whatever it may be worth, I pasted the build failure 
> > to
> > D75068 shortly after it landed with the hope that the original author(s) 
> > would
> > commit a quick fix, but that didn't happen.
> > 
> > 
> > On Wed, Apr 29, 2020, at 10:23 AM, Hans Wennborg wrote:
> > > Your suggestion of
> > >
> > > > if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCLANG_BUILD_STATIC))
> > >
> > > sounds good to me. I don't know what the non-Windows non-PIC problem
> > > was exactly (your commit didn't mention it), so maybe it's best if you
> > > land that to verify it fixes the issue?
> > >
> > > Thanks,
> > > Hans
> > >
> > > On Wed, Apr 29, 2020 at 3:59 PM David Zarzycki  wrote:
> > > >
> > > > Hans,
> > > >
> > > > Non-Windows non-PIC setups were working just fine until four days ago
> > when D75068 landed. I tried to narrowly unbreak non-Windows non-PIC systems
> > but apparently that broke Windows. For that, I'm sorry. That being said, 
> > non-
> > Windows systems are broken again and this breakable was foreseeable given my
> > revert. What is your plan for non-Windows systems?
> > > >
> > > > As a part of the post-revert discussion in D75068, cristian.adam 
> > > > suggested
> > that the check for WIN32 should be added back, but nobody followed through
> > on that. What is stopping us from adding Christian's proposed change?
> > Specifically:
> > > >
> > > > if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCLANG_BUILD_STATIC))
> > > >
> > > > Dave
> > > >
> > > > On Wed, Apr 29, 2020, at 9:19 AM, Hans Wennborg wrote:
> > > > > On Sun, Apr 26, 2020 at 1:17 PM David Zarzycki via cfe-commits
> > > > >  wrote:
> > > > > >
> > > > > >
> > > > > > Author: David Zarzycki
> > > > > > Date: 2020-04-26T07:16:42-04:00
> > > > > > New Revision: 665471907a5c072c6653a38c35f35e5d54cef220
> > > > > >
> > > > > > URL:
> > > > > > https://github.com/llvm/llvm-project/commit/665471907a5c072c6653
> > > > > > a38c35f35e5d54cef220
> > > > > > DIFF:
> > > > > > https://github.com/llvm/llvm-project/commit/665471907a5c072c6653
> > > > > > a38c35f35e5d54cef220.diff
> > > > > >
> > > > > > LOG: [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not
> > > > > > imply PIC
> > > > >
> > > > > But it does imply building libclang.dll.
> > > > >
> > > > > Your change broke building libclang.dll when configured with
> > > > > "cmake -GNinja -DCMAKE_BUILD_TYPE=Release
> > > > > -DLLVM_ENABLE_PROJECTS=clang
> > > > > -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PIC=OFF" on
> > Windows, see
> > > > > the discussion here: https://reviews.llvm.org/D74564#1884556
> > > > >
> > > > > I've reverted in 209ab6d8835cd88320ceb814893759cfbda91d15.
> > > > >
> > > > > >
> > > > > > Added:
> > > > > >
> > > > > >
> > > > > > Modified:
> > > > > > clang/tools/libclang/CMakeLists.txt
> > > > > >
> > > > > > Removed:
> > &g

Re: [clang] 6654719 - [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC

2020-04-29 Thread David Zarzycki via cfe-commits
Okay, sounds good. For whatever it may be worth, I pasted the build failure to 
D75068 shortly after it landed with the hope that the original author(s) would 
commit a quick fix, but that didn't happen.


On Wed, Apr 29, 2020, at 10:23 AM, Hans Wennborg wrote:
> Your suggestion of
> 
> > if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCLANG_BUILD_STATIC))
> 
> sounds good to me. I don't know what the non-Windows non-PIC problem
> was exactly (your commit didn't mention it), so maybe it's best if you
> land that to verify it fixes the issue?
> 
> Thanks,
> Hans
> 
> On Wed, Apr 29, 2020 at 3:59 PM David Zarzycki  wrote:
> >
> > Hans,
> >
> > Non-Windows non-PIC setups were working just fine until four days ago when 
> > D75068 landed. I tried to narrowly unbreak non-Windows non-PIC systems but 
> > apparently that broke Windows. For that, I'm sorry. That being said, 
> > non-Windows systems are broken again and this breakable was foreseeable 
> > given my revert. What is your plan for non-Windows systems?
> >
> > As a part of the post-revert discussion in D75068, cristian.adam suggested 
> > that the check for WIN32 should be added back, but nobody followed through 
> > on that. What is stopping us from adding Christian's proposed change? 
> > Specifically:
> >
> > if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCLANG_BUILD_STATIC))
> >
> > Dave
> >
> > On Wed, Apr 29, 2020, at 9:19 AM, Hans Wennborg wrote:
> > > On Sun, Apr 26, 2020 at 1:17 PM David Zarzycki via cfe-commits
> > >  wrote:
> > > >
> > > >
> > > > Author: David Zarzycki
> > > > Date: 2020-04-26T07:16:42-04:00
> > > > New Revision: 665471907a5c072c6653a38c35f35e5d54cef220
> > > >
> > > > URL: 
> > > > https://github.com/llvm/llvm-project/commit/665471907a5c072c6653a38c35f35e5d54cef220
> > > > DIFF: 
> > > > https://github.com/llvm/llvm-project/commit/665471907a5c072c6653a38c35f35e5d54cef220.diff
> > > >
> > > > LOG: [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply 
> > > > PIC
> > >
> > > But it does imply building libclang.dll.
> > >
> > > Your change broke building libclang.dll when configured with "cmake
> > > -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=clang
> > > -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PIC=OFF" on Windows, see the
> > > discussion here: https://reviews.llvm.org/D74564#1884556
> > >
> > > I've reverted in 209ab6d8835cd88320ceb814893759cfbda91d15.
> > >
> > > >
> > > > Added:
> > > >
> > > >
> > > > Modified:
> > > > clang/tools/libclang/CMakeLists.txt
> > > >
> > > > Removed:
> > > >
> > > >
> > > >
> > > > 
> > > > diff  --git a/clang/tools/libclang/CMakeLists.txt 
> > > > b/clang/tools/libclang/CMakeLists.txt
> > > > index bb2b14cc8e27..9368501592a9 100644
> > > > --- a/clang/tools/libclang/CMakeLists.txt
> > > > +++ b/clang/tools/libclang/CMakeLists.txt
> > > > @@ -77,7 +77,7 @@ if(MSVC)
> > > >set(LLVM_EXPORTED_SYMBOL_FILE)
> > > >  endif()
> > > >
> > > > -if(LLVM_ENABLE_PIC OR NOT LIBCLANG_BUILD_STATIC)
> > > > +if(LLVM_ENABLE_PIC)
> > > >set(ENABLE_SHARED SHARED)
> > > >  endif()
> > > >
> > > >
> > > >
> > > >
> > > > ___
> > > > cfe-commits mailing list
> > > > cfe-commits@lists.llvm.org
> > > > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
> > >
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [clang] 6654719 - [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC

2020-04-29 Thread David Zarzycki via cfe-commits
Hans,

Non-Windows non-PIC setups were working just fine until four days ago when 
D75068 landed. I tried to narrowly unbreak non-Windows non-PIC systems but 
apparently that broke Windows. For that, I'm sorry. That being said, 
non-Windows systems are broken again and this breakable was foreseeable given 
my revert. What is your plan for non-Windows systems?

As a part of the post-revert discussion in D75068, cristian.adam suggested that 
the check for WIN32 should be added back, but nobody followed through on that. 
What is stopping us from adding Christian's proposed change? Specifically:

if(LLVM_ENABLE_PIC OR (WIN32 AND NOT LIBCLANG_BUILD_STATIC))

Dave

On Wed, Apr 29, 2020, at 9:19 AM, Hans Wennborg wrote:
> On Sun, Apr 26, 2020 at 1:17 PM David Zarzycki via cfe-commits
>  wrote:
> >
> >
> > Author: David Zarzycki
> > Date: 2020-04-26T07:16:42-04:00
> > New Revision: 665471907a5c072c6653a38c35f35e5d54cef220
> >
> > URL: 
> > https://github.com/llvm/llvm-project/commit/665471907a5c072c6653a38c35f35e5d54cef220
> > DIFF: 
> > https://github.com/llvm/llvm-project/commit/665471907a5c072c6653a38c35f35e5d54cef220.diff
> >
> > LOG: [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC
> 
> But it does imply building libclang.dll.
> 
> Your change broke building libclang.dll when configured with "cmake
> -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=clang
> -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_PIC=OFF" on Windows, see the
> discussion here: https://reviews.llvm.org/D74564#1884556
> 
> I've reverted in 209ab6d8835cd88320ceb814893759cfbda91d15.
> 
> >
> > Added:
> >
> >
> > Modified:
> > clang/tools/libclang/CMakeLists.txt
> >
> > Removed:
> >
> >
> >
> > 
> > diff  --git a/clang/tools/libclang/CMakeLists.txt 
> > b/clang/tools/libclang/CMakeLists.txt
> > index bb2b14cc8e27..9368501592a9 100644
> > --- a/clang/tools/libclang/CMakeLists.txt
> > +++ b/clang/tools/libclang/CMakeLists.txt
> > @@ -77,7 +77,7 @@ if(MSVC)
> >set(LLVM_EXPORTED_SYMBOL_FILE)
> >  endif()
> >
> > -if(LLVM_ENABLE_PIC OR NOT LIBCLANG_BUILD_STATIC)
> > +if(LLVM_ENABLE_PIC)
> >set(ENABLE_SHARED SHARED)
> >  endif()
> >
> >
> >
> >
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] 6654719 - [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC

2020-04-26 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2020-04-26T07:16:42-04:00
New Revision: 665471907a5c072c6653a38c35f35e5d54cef220

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

LOG: [CMake] Fix logic error: NOT LIBCLANG_BUILD_STATIC does not imply PIC

Added: 


Modified: 
clang/tools/libclang/CMakeLists.txt

Removed: 




diff  --git a/clang/tools/libclang/CMakeLists.txt 
b/clang/tools/libclang/CMakeLists.txt
index bb2b14cc8e27..9368501592a9 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -77,7 +77,7 @@ if(MSVC)
   set(LLVM_EXPORTED_SYMBOL_FILE)
 endif()
 
-if(LLVM_ENABLE_PIC OR NOT LIBCLANG_BUILD_STATIC)
+if(LLVM_ENABLE_PIC)
   set(ENABLE_SHARED SHARED)
 endif()
 



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


Re: [libcxx-dev] [clang] 4ede887 - PR45402: Make the restrictions on constant evaluation of memcmp and

2020-04-05 Thread David Zarzycki via cfe-commits
Subjectively speaking, using char8_t instead of char shouldn’t feel like a 
regression. So yes, making the builtin mem* functions work with char8_t again 
seems right. As for strlen, I can see arguments either way. Personally, if 
you’re concerned about clever macros, then I’d make the overload only visible 
in C++20 mode where char8_t was introduced.

-- 
Sent from my iPhone

> On Apr 5, 2020, at 18:18, Richard Smith  wrote:
> 
> 
>> On Sun, 5 Apr 2020 at 14:44, David Zarzycki via cfe-commits 
>>  wrote:
> 
>> We have overloaded builtins. Can that not solve __builtin_strlen?
> 
> I suppose it could, but we generally want __builtin_ to behave the 
> same as . (The difference would not be visible most of the time, but 
> there's enough pre-existing use of __builtin_strlen through "clever" macros 
> and the like that I'd be worried that this would break something important.) 
> Maybe we should just make the mem* functions work again for char8_t; then you 
> can use __builtin_memchr(p,  0) - p as an optimized compile-time strlen.
>  
>> -- 
>> Sent from my iPhone
>> 
>>>> On Apr 5, 2020, at 14:53, Richard Smith  wrote:
>>>> 
>>> 
>>> Thanks. We need to figure out what the right way to support char8_t with 
>>> string builtins is. These ones could work in principle, whereas things like 
>>> __builtin_strlen would never work because they take operands of the wrong 
>>> types (and we can't cast const char8_t* -> const char* in a constant 
>>> expression).
>>> 
>>>> On Sun, 5 Apr 2020 at 04:14, David Zarzycki via cfe-commits 
>>>>  wrote:
>>>> Hi Richard,
>>>> 
>>>> I'm going to commit a narrow fix to clang to make the libcxx test suite 
>>>> pass again by allowing char8_t again. If you feel that this is the wrong 
>>>> long-term solution, please help the libcxx folks with whatever adjustments 
>>>> they need.
>>>> 
>>>> Thanks!
>>>> 
>>>> Dave
>>>> 
>>>> 
>>>> On Sat, Apr 4, 2020, at 9:55 AM, David Zarzycki via libcxx-dev wrote:
>>>> > Hi Richard,
>>>> > 
>>>> > This breaks libcxx. Can we please revert this or is a quick fix to 
>>>> > libcxx possible?
>>>> > 
>>>> > 
>>>> > FAIL: libc++ :: 
>>>> > std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp
>>>> >  (58624 of 62672)
>>>> >  TEST 'libc++ :: 
>>>> > std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp'
>>>> >  FAILED 
>>>> > Command: ['/p/tllvm/bin/clang++', '-o', 
>>>> > '/tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/Output/compare.pass.cpp.o',
>>>> >  '-x', 'c++', 
>>>> > '/home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp',
>>>> >  '-c', '-v', '-Werror=thread-safety', '-std=c++2a', '-include', 
>>>> > '/home/dave/s/lp/libcxx/test/support/nasty_macros.h', '-nostdinc++', 
>>>> > '-I/home/dave/s/lp/libcxx/include', 
>>>> > '-I/tmp/_update_lc/t/projects/libcxx/include/c++build', 
>>>> > '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', 
>>>> > '-D__STDC_CONSTANT_MACROS', '-I/home/dave/s/lp/libcxx/test/support', 
>>>> > '-ftemplate-depth=270', '-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', 
>>>> > '-Wall', '-Wextra', '-Werror', '-Wuser-defined-warnings', '-Wshadow', 
>>>> > '-Wno-unused-command-line-argument', '-Wno-attributes', 
>>>> > '-Wno-pessimizing-move', '-Wno-c++11-extensions', 
>>>> > '-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wsign-compare', 
>>>> > '-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code', '-c']
>>>> > Exit Code: 1
>>>> > Standard Error:
>>>> > --
>>>> > clang version 11.0.0 (https://github.com/llvm/llvm-project.git 
>>>> > 22127da8f17c03c69231f3631472f7f99ad9cb7f)
>>>> > Target: x86_64-unknown-linux-gnu
>>>> > Thread model: posix
>>>> > InstalledDir: /p/tllvm/bin
>>>> > Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
>>>> > Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/

Re: [libcxx-dev] [clang] 4ede887 - PR45402: Make the restrictions on constant evaluation of memcmp and

2020-04-05 Thread David Zarzycki via cfe-commits
We have overloaded builtins. Can that not solve __builtin_strlen?

-- 
Sent from my iPhone

> On Apr 5, 2020, at 14:53, Richard Smith  wrote:
> 
> 
> Thanks. We need to figure out what the right way to support char8_t with 
> string builtins is. These ones could work in principle, whereas things like 
> __builtin_strlen would never work because they take operands of the wrong 
> types (and we can't cast const char8_t* -> const char* in a constant 
> expression).
> 
>> On Sun, 5 Apr 2020 at 04:14, David Zarzycki via cfe-commits 
>>  wrote:
>> Hi Richard,
>> 
>> I'm going to commit a narrow fix to clang to make the libcxx test suite pass 
>> again by allowing char8_t again. If you feel that this is the wrong 
>> long-term solution, please help the libcxx folks with whatever adjustments 
>> they need.
>> 
>> Thanks!
>> 
>> Dave
>> 
>> 
>> On Sat, Apr 4, 2020, at 9:55 AM, David Zarzycki via libcxx-dev wrote:
>> > Hi Richard,
>> > 
>> > This breaks libcxx. Can we please revert this or is a quick fix to 
>> > libcxx possible?
>> > 
>> > 
>> > FAIL: libc++ :: 
>> > std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp
>> >  (58624 of 62672)
>> >  TEST 'libc++ :: 
>> > std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp'
>> >  FAILED 
>> > Command: ['/p/tllvm/bin/clang++', '-o', 
>> > '/tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/Output/compare.pass.cpp.o',
>> >  '-x', 'c++', 
>> > '/home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp',
>> >  '-c', '-v', '-Werror=thread-safety', '-std=c++2a', '-include', 
>> > '/home/dave/s/lp/libcxx/test/support/nasty_macros.h', '-nostdinc++', 
>> > '-I/home/dave/s/lp/libcxx/include', 
>> > '-I/tmp/_update_lc/t/projects/libcxx/include/c++build', 
>> > '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', 
>> > '-D__STDC_CONSTANT_MACROS', '-I/home/dave/s/lp/libcxx/test/support', 
>> > '-ftemplate-depth=270', '-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', 
>> > '-Wextra', '-Werror', '-Wuser-defined-warnings', '-Wshadow', 
>> > '-Wno-unused-command-line-argument', '-Wno-attributes', 
>> > '-Wno-pessimizing-move', '-Wno-c++11-extensions', 
>> > '-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wsign-compare', 
>> > '-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code', '-c']
>> > Exit Code: 1
>> > Standard Error:
>> > --
>> > clang version 11.0.0 (https://github.com/llvm/llvm-project.git 
>> > 22127da8f17c03c69231f3631472f7f99ad9cb7f)
>> > Target: x86_64-unknown-linux-gnu
>> > Thread model: posix
>> > InstalledDir: /p/tllvm/bin
>> > Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
>> > Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
>> > Candidate multilib: .;@m64
>> > Candidate multilib: 32;@m32
>> > Selected multilib: .;@m64
>> >  (in-process)
>> >  "/p/tllvm/bin/clang-11" -cc1 -triple x86_64-unknown-linux-gnu 
>> > -emit-obj -mrelax-all -disable-free -disable-llvm-verifier 
>> > -discard-value-names -main-file-name compare.pass.cpp 
>> > -mrelocation-model static -mthread-model posix -mframe-pointer=all 
>> > -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables 
>> > -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining 
>> > -debugger-tuning=gdb -v -nostdinc++ -resource-dir 
>> > /p/tllvm/lib64/clang/11.0.0 -include 
>> > /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I 
>> > /home/dave/s/lp/libcxx/include -I 
>> > /tmp/_update_lc/t/projects/libcxx/include/c++build -D 
>> > __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS 
>> > -I /home/dave/s/lp/libcxx/test/support -D 
>> > _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -internal-isystem 
>> > /usr/local/include -internal-isystem 
>> > /p/tllvm/lib64/clang/11.0.0/include -internal-externc-isystem /include 
>> > -internal-externc-isystem /usr/include -Werror=thread-safety -Wall 
>> > -Wextra -Werror -Wuser-defined-warnings -Wshadow 
>> > -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move 
>> > -Wno-c++11-extensions -Wno-user-defined-lit

[clang] 2c88a48 - [clang] Make libcxx test suite pass again after memcmp changes

2020-04-05 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2020-04-05T07:16:47-04:00
New Revision: 2c88a485c71155c19e512f22c54e63ee337282a3

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

LOG: [clang] Make libcxx test suite pass again after memcmp changes

Added: 


Modified: 
clang/lib/AST/ExprConstant.cpp

Removed: 




diff  --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index a83b2e24e17f..7508bcbc365d 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -11154,9 +11154,11 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const 
CallExpr *E,
 CharTy1, E->getArg(0)->getType()->getPointeeType()) &&
 Info.Ctx.hasSameUnqualifiedType(CharTy1, CharTy2)));
 
-// For memcmp, allow comparing any arrays of '[[un]signed] char',
-// but no other types.
-if (IsRawByte && !(CharTy1->isCharType() && CharTy2->isCharType())) {
+// For memcmp, allow comparing any arrays of '[[un]signed] char' or
+// 'char8_t', but no other types.
+bool IsChar = CharTy1->isCharType() && CharTy2->isCharType();
+bool IsChar8 = CharTy1->isChar8Type() && CharTy2->isChar8Type();
+if (IsRawByte && !IsChar && !IsChar8) {
   // FIXME: Consider using our bit_cast implementation to support this.
   Info.FFDiag(E, diag::note_constexpr_memcmp_unsupported)
   << (std::string("'") + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + "'")



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


Re: [libcxx-dev] [clang] 4ede887 - PR45402: Make the restrictions on constant evaluation of memcmp and

2020-04-05 Thread David Zarzycki via cfe-commits
Hi Richard,

I'm going to commit a narrow fix to clang to make the libcxx test suite pass 
again by allowing char8_t again. If you feel that this is the wrong long-term 
solution, please help the libcxx folks with whatever adjustments they need.

Thanks!

Dave


On Sat, Apr 4, 2020, at 9:55 AM, David Zarzycki via libcxx-dev wrote:
> Hi Richard,
> 
> This breaks libcxx. Can we please revert this or is a quick fix to 
> libcxx possible?
> 
> 
> FAIL: libc++ :: 
> std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp
>  (58624 of 62672)
>  TEST 'libc++ :: 
> std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp'
>  FAILED 
> Command: ['/p/tllvm/bin/clang++', '-o', 
> '/tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/Output/compare.pass.cpp.o',
>  '-x', 'c++', 
> '/home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp',
>  '-c', '-v', '-Werror=thread-safety', '-std=c++2a', '-include', 
> '/home/dave/s/lp/libcxx/test/support/nasty_macros.h', '-nostdinc++', 
> '-I/home/dave/s/lp/libcxx/include', 
> '-I/tmp/_update_lc/t/projects/libcxx/include/c++build', 
> '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', 
> '-D__STDC_CONSTANT_MACROS', '-I/home/dave/s/lp/libcxx/test/support', 
> '-ftemplate-depth=270', '-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', 
> '-Wextra', '-Werror', '-Wuser-defined-warnings', '-Wshadow', 
> '-Wno-unused-command-line-argument', '-Wno-attributes', 
> '-Wno-pessimizing-move', '-Wno-c++11-extensions', 
> '-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wsign-compare', 
> '-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code', '-c']
> Exit Code: 1
> Standard Error:
> --
> clang version 11.0.0 (https://github.com/llvm/llvm-project.git 
> 22127da8f17c03c69231f3631472f7f99ad9cb7f)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> InstalledDir: /p/tllvm/bin
> Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
> Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
> Candidate multilib: .;@m64
> Candidate multilib: 32;@m32
> Selected multilib: .;@m64
>  (in-process)
>  "/p/tllvm/bin/clang-11" -cc1 -triple x86_64-unknown-linux-gnu 
> -emit-obj -mrelax-all -disable-free -disable-llvm-verifier 
> -discard-value-names -main-file-name compare.pass.cpp 
> -mrelocation-model static -mthread-model posix -mframe-pointer=all 
> -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables 
> -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining 
> -debugger-tuning=gdb -v -nostdinc++ -resource-dir 
> /p/tllvm/lib64/clang/11.0.0 -include 
> /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I 
> /home/dave/s/lp/libcxx/include -I 
> /tmp/_update_lc/t/projects/libcxx/include/c++build -D 
> __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS 
> -I /home/dave/s/lp/libcxx/test/support -D 
> _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -internal-isystem 
> /usr/local/include -internal-isystem 
> /p/tllvm/lib64/clang/11.0.0/include -internal-externc-isystem /include 
> -internal-externc-isystem /usr/include -Werror=thread-safety -Wall 
> -Wextra -Werror -Wuser-defined-warnings -Wshadow 
> -Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move 
> -Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type 
> -Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code 
> -std=c++2a -fdeprecated-macro -fdebug-compilation-dir 
> /tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t
>  -ftemplate-depth 270 -ferror-limit 19 -fgnuc-version=4.2.1 
> -fno-implicit-modules -fcxx-exceptions -fexceptions -faddrsig -o 
> /tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/Output/compare.pass.cpp.o
>  -x c++ 
> /home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp
> clang -cc1 version 11.0.0 based upon LLVM 11.0.0git default target 
> x86_64-unknown-linux-gnu
> ignoring nonexistent directory "/include"
> #include "..." search starts here:
> #include <...> search starts here:
>  /home/dave/s/lp/libcxx/include
>  /tmp/_update_lc/t/projects/libcxx/include/c++build
>  /home/dave/s/lp/libcxx/test/support
>  /usr/local/include
>  /p/tllvm/lib64/clang/11.0.0/include
>  /usr/include
> End of search list.
> /home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp:53:19:
>  error: static_assert expression is not an integral constant expression
> static_assert(test_constexpr(), "" );
>   ^~~~
> 

Re: [clang] 4ede887 - PR45402: Make the restrictions on constant evaluation of memcmp and

2020-04-04 Thread David Zarzycki via cfe-commits
Hi Richard,

This breaks libcxx. Can we please revert this or is a quick fix to libcxx 
possible?


FAIL: libc++ :: 
std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp
 (58624 of 62672)
 TEST 'libc++ :: 
std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp'
 FAILED 
Command: ['/p/tllvm/bin/clang++', '-o', 
'/tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/Output/compare.pass.cpp.o',
 '-x', 'c++', 
'/home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp',
 '-c', '-v', '-Werror=thread-safety', '-std=c++2a', '-include', 
'/home/dave/s/lp/libcxx/test/support/nasty_macros.h', '-nostdinc++', 
'-I/home/dave/s/lp/libcxx/include', 
'-I/tmp/_update_lc/t/projects/libcxx/include/c++build', 
'-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', 
'-I/home/dave/s/lp/libcxx/test/support', '-ftemplate-depth=270', 
'-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', '-Wextra', '-Werror', 
'-Wuser-defined-warnings', '-Wshadow', '-Wno-unused-command-line-argument', 
'-Wno-attributes', '-Wno-pessimizing-move', '-Wno-c++11-extensions', 
'-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wsign-compare', 
'-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code', '-c']
Exit Code: 1
Standard Error:
--
clang version 11.0.0 (https://github.com/llvm/llvm-project.git 
22127da8f17c03c69231f3631472f7f99ad9cb7f)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /p/tllvm/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 (in-process)
 "/p/tllvm/bin/clang-11" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj 
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names 
-main-file-name compare.pass.cpp -mrelocation-model static -mthread-model posix 
-mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases 
-munwind-tables -target-cpu x86-64 -dwarf-column-info -fno-split-dwarf-inlining 
-debugger-tuning=gdb -v -nostdinc++ -resource-dir /p/tllvm/lib64/clang/11.0.0 
-include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I 
/home/dave/s/lp/libcxx/include -I 
/tmp/_update_lc/t/projects/libcxx/include/c++build -D __STDC_FORMAT_MACROS -D 
__STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -I 
/home/dave/s/lp/libcxx/test/support -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER 
-internal-isystem /usr/local/include -internal-isystem 
/p/tllvm/lib64/clang/11.0.0/include -internal-externc-isystem /include 
-internal-externc-isystem /usr/include -Werror=thread-safety -Wall -Wextra 
-Werror -Wuser-defined-warnings -Wshadow -Wno-unused-command-line-argument 
-Wno-attributes -Wno-pessimizing-move -Wno-c++11-extensions 
-Wno-user-defined-literals -Wno-noexcept-type -Wsign-compare -Wunused-variable 
-Wunused-parameter -Wunreachable-code -std=c++2a -fdeprecated-macro 
-fdebug-compilation-dir 
/tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t
 -ftemplate-depth 270 -ferror-limit 19 -fgnuc-version=4.2.1 
-fno-implicit-modules -fcxx-exceptions -fexceptions -faddrsig -o 
/tmp/_update_lc/t/projects/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/Output/compare.pass.cpp.o
 -x c++ 
/home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp
clang -cc1 version 11.0.0 based upon LLVM 11.0.0git default target 
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/dave/s/lp/libcxx/include
 /tmp/_update_lc/t/projects/libcxx/include/c++build
 /home/dave/s/lp/libcxx/test/support
 /usr/local/include
 /p/tllvm/lib64/clang/11.0.0/include
 /usr/include
End of search list.
/home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp:53:19:
 error: static_assert expression is not an integral constant expression
static_assert(test_constexpr(), "" );
  ^~~~
/home/dave/s/lp/libcxx/include/__string:662:12: note: constant evaluation of 
'__builtin_memcmp' between arrays of types 'const char8_t' and 'const char8_t' 
is not supported; only arrays of narrow character types can be compared
return __builtin_memcmp(__s1, __s2, __n);
   ^
/home/dave/s/lp/libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp:24:12:
 note: in call to 'compare("123"[0], "223"[0], 3)'
return 

[clang] 0d61cd2 - Verify that clang's max alignment is <= LLVM's max alignment

2020-01-24 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2020-01-24T12:37:05-05:00
New Revision: 0d61cd25a6927a7700bfb1636faca1ef16c46428

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

LOG: Verify that clang's max alignment is <= LLVM's max alignment

Reviewers: lebedev.ri

Reviewed By: lebedev.ri

Subscribers: cfe-commits

Tags: #llvm, #clang

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

Added: 


Modified: 
clang/include/clang/Sema/Sema.h
clang/lib/CodeGen/CGValue.h

Removed: 




diff  --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 92d964d6603d..029637563d41 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -372,16 +372,17 @@ class Sema final {
   QualType ResultTy,
   ArrayRef Args);
 
+public:
   /// The maximum alignment, same as in llvm::Value. We duplicate them here
   /// because that allows us not to duplicate the constants in clang code,
   /// which we must to since we can't directly use the llvm constants.
+  /// The value is verified against llvm here: lib/CodeGen/CGValue.h
   ///
   /// This is the greatest alignment value supported by load, store, and alloca
   /// instructions, and global values.
   static const unsigned MaxAlignmentExponent = 29;
   static const unsigned MaximumAlignment = 1u << MaxAlignmentExponent;
 
-public:
   typedef OpaquePtr DeclGroupPtrTy;
   typedef OpaquePtr TemplateTy;
   typedef OpaquePtr TypeTy;

diff  --git a/clang/lib/CodeGen/CGValue.h b/clang/lib/CodeGen/CGValue.h
index 9fd07bdb187d..4d6c3950e5e4 100644
--- a/clang/lib/CodeGen/CGValue.h
+++ b/clang/lib/CodeGen/CGValue.h
@@ -15,12 +15,16 @@
 #define LLVM_CLANG_LIB_CODEGEN_CGVALUE_H
 
 #include "clang/AST/ASTContext.h"
+#include "clang/Sema/Sema.h"
 #include "clang/AST/Type.h"
 #include "llvm/IR/Value.h"
 #include "llvm/IR/Type.h"
 #include "Address.h"
 #include "CodeGenTBAA.h"
 
+static_assert(clang::Sema::MaximumAlignment <= llvm::Value::MaximumAlignment,
+  "Clang max alignment greater than what LLVM supports?");
+
 namespace llvm {
   class Constant;
   class MDNode;



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


[clang] 75e500d - Add missing `REQUIRES: hexagon-registered-target`

2019-12-21 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2019-12-21T06:45:30-05:00
New Revision: 75e500dd4713e785f0ca7afc37e7ba206a4391b0

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

LOG: Add missing `REQUIRES: hexagon-registered-target`

After d567b0ba841d4b6f4b0d906da350a3bb2b2f769f, the test suite no longer
passes if hexagon is disabled.

Added: 


Modified: 
clang/test/Driver/hexagon-toolchain-elf.c

Removed: 




diff  --git a/clang/test/Driver/hexagon-toolchain-elf.c 
b/clang/test/Driver/hexagon-toolchain-elf.c
index 0339619e1c1f..cf7d8bdb3931 100644
--- a/clang/test/Driver/hexagon-toolchain-elf.c
+++ b/clang/test/Driver/hexagon-toolchain-elf.c
@@ -545,6 +545,7 @@
 // RUN:   -mcpu=hexagonv60 \
 // RUN:   %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK081 %s
+// REQUIRES: hexagon-registered-target
 // CHECK081:  "-march=hexagon"
 // CHECK081:  "-mcpu=hexagonv60"
 // 
-



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


[clang] b324902 - Revert "Driver: Don't look for libc++ headers in the install directory on Android."

2019-12-08 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2019-12-08T16:41:46+02:00
New Revision: b32490270b786d2c5ba154e613ee2d5e36ed4197

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

LOG: Revert "Driver: Don't look for libc++ headers in the install directory on 
Android."

This reverts commit 198fbcb817492ff45946e3f7517de15e8cdf0607.

This breaks Fedora 31.

Added: 


Modified: 
clang/lib/Driver/ToolChains/Linux.cpp
clang/test/Driver/stdlibxx-isystem.cpp

Removed: 
clang/test/Driver/android-no-installed-libcxx.cpp



diff  --git a/clang/lib/Driver/ToolChains/Linux.cpp 
b/clang/lib/Driver/ToolChains/Linux.cpp
index adacd705d831..736a2d435ca5 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -888,25 +888,20 @@ static std::string 
DetectLibcxxIncludePath(llvm::vfs::FileSystem ,
 void Linux::addLibCxxIncludePaths(const llvm::opt::ArgList ,
   llvm::opt::ArgStringList ) const {
   const std::string& SysRoot = computeSysRoot();
-  auto AddIncludePath = [&](std::string Path) {
-std::string IncludePath = DetectLibcxxIncludePath(getVFS(), Path);
+  const std::string LibCXXIncludePathCandidates[] = {
+  DetectLibcxxIncludePath(getVFS(), getDriver().Dir + "/../include/c++"),
+  // If this is a development, non-installed, clang, libcxx will
+  // not be found at ../include/c++ but it likely to be found at
+  // one of the following two locations:
+  DetectLibcxxIncludePath(getVFS(), SysRoot + "/usr/local/include/c++"),
+  DetectLibcxxIncludePath(getVFS(), SysRoot + "/usr/include/c++") };
+  for (const auto  : LibCXXIncludePathCandidates) {
 if (IncludePath.empty() || !getVFS().exists(IncludePath))
-  return false;
+  continue;
+// Use the first candidate that exists.
 addSystemInclude(DriverArgs, CC1Args, IncludePath);
-return true;
-  };
-  // Android never uses the libc++ headers installed alongside the toolchain,
-  // which are generally incompatible with the NDK libraries anyway.
-  if (!getTriple().isAndroid())
-if (AddIncludePath(getDriver().Dir + "/../include/c++"))
-  return;
-  // If this is a development, non-installed, clang, libcxx will
-  // not be found at ../include/c++ but it likely to be found at
-  // one of the following two locations:
-  if (AddIncludePath(SysRoot + "/usr/local/include/c++"))
-return;
-  if (AddIncludePath(SysRoot + "/usr/include/c++"))
 return;
+  }
 }
 
 void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList ,

diff  --git a/clang/test/Driver/android-no-installed-libcxx.cpp 
b/clang/test/Driver/android-no-installed-libcxx.cpp
deleted file mode 100644
index b6f4227c7dc1..
--- a/clang/test/Driver/android-no-installed-libcxx.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// Check that we don't find the libc++ in the installation directory when
-// targeting Android.
-
-// RUN: mkdir -p %t/bin
-// RUN: mkdir -p %t/include/c++/v1
-// RUN: %clang -target aarch64-linux-android -ccc-install-dir %t/bin \
-// RUN:   -stdlib=libc++ -fsyntax-only %s -### 2>&1 | FileCheck %s
-// CHECK-NOT: "-internal-isystem" "{{.*}}v1"

diff  --git a/clang/test/Driver/stdlibxx-isystem.cpp 
b/clang/test/Driver/stdlibxx-isystem.cpp
index 827cdf9a7c71..cf7535ff423e 100644
--- a/clang/test/Driver/stdlibxx-isystem.cpp
+++ b/clang/test/Driver/stdlibxx-isystem.cpp
@@ -6,7 +6,7 @@
 // By default, we should search for libc++ next to the driver.
 // RUN: mkdir -p %t/bin
 // RUN: mkdir -p %t/include/c++/v1
-// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: %clang -target aarch64-linux-android -ccc-install-dir %t/bin \
 // RUN:   -stdlib=libc++ -fsyntax-only %s -### 2>&1 | \
 // RUN:   FileCheck -check-prefix=LIBCXX %s
 // RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \
@@ -16,7 +16,7 @@
 // LIBCXX: "-internal-isystem" "[[INSTALLDIR]]/../include/c++/v1"
 
 // Passing -stdlib++-isystem should suppress the default search.
-// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: %clang -target aarch64-linux-android -ccc-install-dir %t/bin \
 // RUN:   -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ 
\
 // RUN:   -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=NODEFAULT %s
 // RUN: %clang -target x86_64-apple-darwin -ccc-install-dir %t/bin \
@@ -26,7 +26,7 @@
 // NODEFAULT-NOT: "-internal-isystem" "[[INSTALLDIR]]/../include/c++/v1"
 
 // And we should add it as an -internal-isystem.
-// RUN: %clang -target aarch64-linux-gnu -ccc-install-dir %t/bin \
+// RUN: %clang -target aarch64-linux-android -ccc-install-dir %t/bin \
 // RUN:   -stdlib++-isystem /tmp/foo -stdlib++-isystem /tmp/bar -stdlib=libc++ 
\
 // RUN:   -fsyntax-only %s -### 2>&1 | FileCheck -check-prefix=INCPATH 

[clang] ed33cb5 - [RISCV] Add missing REQUIRES to clang tests

2019-11-23 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2019-11-23T14:47:09+02:00
New Revision: ed33cb5b147402c06a3e0a9082b0f991a9d91a1b

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

LOG: [RISCV] Add missing REQUIRES to clang tests

Fixes: e0f22fe04a5c9eb244ff0533549743b7deb03b99

Added: 


Modified: 
clang/test/Driver/riscv32-toolchain-extra.c
clang/test/Driver/riscv64-toolchain-extra.c

Removed: 




diff  --git a/clang/test/Driver/riscv32-toolchain-extra.c 
b/clang/test/Driver/riscv32-toolchain-extra.c
index d07d0f199ae2..a52972f6020a 100644
--- a/clang/test/Driver/riscv32-toolchain-extra.c
+++ b/clang/test/Driver/riscv32-toolchain-extra.c
@@ -3,7 +3,7 @@
 // The tests here are similar to those in riscv32-toolchain.c, however
 // these tests need to create symlinks to test directory trees in order to
 // set up the environment and therefore shell support is required.
-// REQUIRES: shell
+// REQUIRES: shell, riscv-registered-target
 // UNSUPPORTED: system-windows
 
 // If there is no GCC install detected then the driver searches for executables

diff  --git a/clang/test/Driver/riscv64-toolchain-extra.c 
b/clang/test/Driver/riscv64-toolchain-extra.c
index 243adecc5ecb..999b8c95fae4 100644
--- a/clang/test/Driver/riscv64-toolchain-extra.c
+++ b/clang/test/Driver/riscv64-toolchain-extra.c
@@ -3,7 +3,7 @@
 // The tests here are similar to those in riscv64-toolchain.c, however
 // these tests need to create symlinks to test directory trees in order to
 // set up the environment and therefore shell support is required.
-// REQUIRES: shell
+// REQUIRES: shell, riscv-registered-target
 // UNSUPPORTED: system-windows
 
 // If there is no GCC install detected then the driver searches for executables



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


[clang] 39af723 - Unbreak the clang test suite when hexagon-link is not available

2019-11-14 Thread David Zarzycki via cfe-commits

Author: David Zarzycki
Date: 2019-11-15T08:47:02+02:00
New Revision: 39af72378dd0481472e267ed7f15da594de0fee3

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

LOG: Unbreak the clang test suite when hexagon-link is not available

All of the other tests are of the form {{hexagon-link|ld}} so this
probably should be too.

Added: 


Modified: 
clang/test/Driver/hexagon-toolchain-elf.c

Removed: 




diff  --git a/clang/test/Driver/hexagon-toolchain-elf.c 
b/clang/test/Driver/hexagon-toolchain-elf.c
index 237242e7cbf1..661e758d931b 100644
--- a/clang/test/Driver/hexagon-toolchain-elf.c
+++ b/clang/test/Driver/hexagon-toolchain-elf.c
@@ -132,7 +132,7 @@
 // RUN:   %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK029 %s
 // CHECK029: "-cc1" {{.*}} "-target-cpu" "hexagonv65"
-// CHECK029: 
hexagon-link{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0
+// CHECK029: 
{{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v65/crt0
 
 // 
-
 // Test Linker related args



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


Re: r374133 - [c++20] Implement most of P1152R4.

2019-10-11 Thread David Zarzycki via cfe-commits
Hi Richard,

This breaks libcxx and libcxxabi my local stage two build bot (Fedora 31 
x86_64). Is this expected? Can we revert this?

FAIL: libc++ :: std/utilities/meta/meta.rel/is_invocable.pass.cpp (55505 of 
58603)
 TEST 'libc++ :: 
std/utilities/meta/meta.rel/is_invocable.pass.cpp' FAILED 
Command: ['/p/tllvm/bin/clang++', '-o', 
'/tmp/_update_lc/t/projects/libcxx/test/std/utilities/meta/meta.rel/Output/is_invocable.pass.cpp.o',
 '-x', 'c++', 
'/home/dave/s/lp/libcxx/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp',
 '-c', '-v', '-ftemplate-depth=270', '-Werror=thread-safety', '-std=c++2a', 
'-include', '/home/dave/s/lp/libcxx/test/support/nasty_macros.h', 
'-nostdinc++', '-I/home/dave/s/lp/libcxx/include', 
'-I/tmp/_update_lc/t/projects/libcxx/include/c++build', 
'-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', 
'-I/home/dave/s/lp/libcxx/test/support', 
'-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="/home/dave/s/lp/libcxx/test/std/input.output/filesystems/Inputs/static_test_env"',
 
'-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT="/tmp/_update_lc/t/projects/libcxx/test/filesystem/Output/dynamic_env"',
 '-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER="/usr/bin/python 
/home/dave/s/lp/libcxx/test/support/filesystem_dynamic_test_helper.py"', 
'-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', '-Wextra', '-Werror', 
'-Wuser-defined-warnings', '-Wshadow', '-Wno-unused-command-line-argument', 
'-Wno-attributes', '-Wno-pessimizing-move', '-Wno-c++11-extensions', 
'-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wsign-compare', 
'-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code', '-c']
Exit Code: 1
Standard Error:
--
clang version 10.0.0 (/home/dave/s/lp/clang 
0746aafd89754a2ae9992c4d6394e3b4f3623b1d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /p/tllvm/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/p/tllvm/bin/clang-10" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj 
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names 
-main-file-name is_invocable.pass.cpp -mrelocation-model static -mthread-model 
posix -mframe-pointer=all -fmath-errno -masm-verbose -mconstructor-aliases 
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info 
-debugger-tuning=gdb -v -nostdinc++ -resource-dir /p/tllvm/lib64/clang/10.0.0 
-include /home/dave/s/lp/libcxx/test/support/nasty_macros.h -I 
/home/dave/s/lp/libcxx/include -I 
/tmp/_update_lc/t/projects/libcxx/include/c++build -D __STDC_FORMAT_MACROS -D 
__STDC_LIMIT_MACROS -D __STDC_CONSTANT_MACROS -I 
/home/dave/s/lp/libcxx/test/support -D 
"LIBCXX_FILESYSTEM_STATIC_TEST_ROOT=\"/home/dave/s/lp/libcxx/test/std/input.output/filesystems/Inputs/static_test_env\""
 -D 
"LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT=\"/tmp/_update_lc/t/projects/libcxx/test/filesystem/Output/dynamic_env\""
 -D "LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER=\"/usr/bin/python 
/home/dave/s/lp/libcxx/test/support/filesystem_dynamic_test_helper.py\"" -D 
_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -internal-isystem /usr/local/include 
-internal-isystem /p/tllvm/lib64/clang/10.0.0/include -internal-externc-isystem 
/include -internal-externc-isystem /usr/include -Werror=thread-safety -Wall 
-Wextra -Werror -Wuser-defined-warnings -Wshadow 
-Wno-unused-command-line-argument -Wno-attributes -Wno-pessimizing-move 
-Wno-c++11-extensions -Wno-user-defined-literals -Wno-noexcept-type 
-Wsign-compare -Wunused-variable -Wunused-parameter -Wunreachable-code 
-std=c++2a -fdeprecated-macro -fdebug-compilation-dir 
/tmp/_update_lc/t/projects/libcxx/test/std/utilities/meta/meta.rel 
-ftemplate-depth 270 -ferror-limit 19 -fmessage-length 0 -fno-implicit-modules 
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option 
-faddrsig -o 
/tmp/_update_lc/t/projects/libcxx/test/std/utilities/meta/meta.rel/Output/is_invocable.pass.cpp.o
 -x c++ 
/home/dave/s/lp/libcxx/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp
clang -cc1 version 10.0.0 based upon LLVM 10.0.0svn default target 
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/dave/s/lp/libcxx/include
 /tmp/_update_lc/t/projects/libcxx/include/c++build
 /home/dave/s/lp/libcxx/test/support
 /usr/local/include
 /p/tllvm/lib64/clang/10.0.0/include
 /usr/include
End of search list.
In file included from 
/home/dave/s/lp/libcxx/test/std/utilities/meta/meta.rel/is_invocable.pass.cpp:21:
/home/dave/s/lp/libcxx/include/type_traits:1123:22: error: volatile-qualified 
return type 'volatile void' is deprecated [-Werror,-Wdeprecated-volatile]
template  _Tp   __declval(long);
 ^
/home/dave/s/lp/libcxx/include/type_traits:3640:31: note: in instantiation of 
template class 

r372949 - [Testing] Workaround libcxx bug when OS is "none"

2019-09-26 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Thu Sep 26 01:19:44 2019
New Revision: 372949

URL: http://llvm.org/viewvc/llvm-project?rev=372949=rev
Log:
[Testing] Workaround libcxx bug when OS is "none"

If clang is configured to use libcxx as the default C++ standard
library, then using "none" for the OS in the target triple will cause
libcxx to #error needlessly. Passing -nostdinc++ is a workaround for
these tests. See also: https://reviews.llvm.org/D68075

Please note: this workaround will probably exist for a few years until
the installed version of libcxx is updated.

Modified:
cfe/trunk/test/Headers/arm-fp16-header.c
cfe/trunk/test/Headers/arm-neon-header.c

Modified: cfe/trunk/test/Headers/arm-fp16-header.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/arm-fp16-header.c?rev=372949=372948=372949=diff
==
--- cfe/trunk/test/Headers/arm-fp16-header.c (original)
+++ cfe/trunk/test/Headers/arm-fp16-header.c Thu Sep 26 01:19:44 2019
@@ -6,14 +6,14 @@
 // RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c99 -xc %s
 // RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c11 -xc %s
 
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
 
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
 
 #include 

Modified: cfe/trunk/test/Headers/arm-neon-header.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/arm-neon-header.c?rev=372949=372948=372949=diff
==
--- cfe/trunk/test/Headers/arm-neon-header.c (original)
+++ cfe/trunk/test/Headers/arm-neon-header.c Thu Sep 26 01:19:44 2019
@@ -10,14 +10,14 @@
 // RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c99 -xc %s
 // RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64_be-none-eabi -march=armv8.2-a+fp16 -std=c11 -xc %s
 
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++14 -xc++ %s
-// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++17 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++98 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror -ffreestanding -nostdinc++ 
--target=aarch64-none-eabi -march=armv8.2-a+fp16 -std=c++11 -xc++ %s
+// RUN: %clang -fsyntax-only -Wall -Werror 

r371710 - [WebAssembly] Add REQUIRES to test

2019-09-12 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Wed Sep 11 23:50:33 2019
New Revision: 371710

URL: http://llvm.org/viewvc/llvm-project?rev=371710=rev
Log:
[WebAssembly] Add REQUIRES to test

Modified:
cfe/trunk/test/CodeGenCXX/wasm-eh.cpp

Modified: cfe/trunk/test/CodeGenCXX/wasm-eh.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/wasm-eh.cpp?rev=371710=371709=371710=diff
==
--- cfe/trunk/test/CodeGenCXX/wasm-eh.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/wasm-eh.cpp Wed Sep 11 23:50:33 2019
@@ -1,6 +1,7 @@
 // RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -fwasm-exceptions -target-feature 
+exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
 // RUN: %clang_cc1 %s -triple wasm64-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -fwasm-exceptions -target-feature 
+exception-handling -emit-llvm -o - -std=c++11 | FileCheck %s
 // RUN: %clang_cc1 %s -triple wasm32-unknown-unknown -fms-extensions 
-fexceptions -fcxx-exceptions -fwasm-exceptions -target-feature 
+exception-handling -S -o - -std=c++11 | FileCheck %s --check-prefix=ASSEMBLY
+// REQUIRES: webassembly-registered-target
 
 void may_throw();
 void dont_throw() noexcept;


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


Re: r369830 - NFC: Rename some sanitizer related lifetime checks

2019-08-27 Thread David Zarzycki via cfe-commits
Hi Vitaly,

Thanks for fixing this! And I’m sorry about accidentally disabling the test 
entirely by adding “REQUIRES: assertions” instead of “REQUIRES: asserts”.

Dave

> On Aug 27, 2019, at 1:10 AM, Vitaly Buka  wrote:
> 
> fixed with r369992
> 
> On Mon, Aug 26, 2019 at 1:16 PM Vitaly Buka  > wrote:
> Thank for the try, but it's not the fix as it just disabled the test 
> everywhere as no one sets "assertions".
> Also I am not sure how the patch can break the test, it just renamed the 
> files. Which bot was that?
> Is it possible that your local checkout just had the test disabled?
> 
> On Sat, Aug 24, 2019 at 1:12 AM David Zarzycki  > wrote:
> Fix: r369843
> 
> Please confirm. Thanks!
> 
> > On Aug 24, 2019, at 8:18 AM, David Zarzycki  > > wrote:
> > 
> > This seems to have broken building on Red Hat Fedora Linux 30 (x86_64). Was 
> > this expected?
> > 
> > FAIL: Clang :: CodeGenCXX/lifetime-sanitizer.cpp (7750 of 50751)
> >  TEST 'Clang :: CodeGenCXX/lifetime-sanitizer.cpp' 
> > FAILED 
> > Script:
> > --
> > : 'RUN: at line 1';   /tmp/_update_lc/r/bin/clang -w -target 
> > x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0 
> > /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp |   
> > /tmp/_update_lc/r/bin/FileCheck 
> > /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp 
> > -check-prefixes=CHECK,CHECK-O0 --implicit-check-not=llvm.lifetime
> > : 'RUN: at line 3';   /tmp/_update_lc/r/bin/clang -w -target 
> > x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions -O0  
> > -fsanitize=address -fsanitize-address-use-after-scope 
> > /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp |  
> > /tmp/_update_lc/r/bin/FileCheck 
> > /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp 
> > -check-prefixes=CHECK,LIFETIME
> > --
> > Exit Code: 1
> > 
> > Command Output (stderr):
> > --
> > /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp:30:18: error: 
> > CHECK-LABEL: expected string not found in input
> > // CHECK-LABEL: cond.true:
> > ^
> > :21:8: note: scanning from here
> > br i1 %7, label %8, label %10
> >   ^
> > :25:6: note: possible intended match here
> > store i1 true, i1* %4, align 1
> > ^
> > 
> > 
> > 
> >> On Aug 24, 2019, at 2:31 AM, Vitaly Buka via cfe-commits 
> >> mailto:cfe-commits@lists.llvm.org>> wrote:
> >> 
> >> Author: vitalybuka
> >> Date: Fri Aug 23 18:31:38 2019
> >> New Revision: 369830
> >> 
> >> URL: http://llvm.org/viewvc/llvm-project?rev=369830=rev 
> >> 
> >> Log:
> >> NFC: Rename some sanitizer related lifetime checks
> >> 
> >> Added:
> >>   cfe/trunk/test/CodeGen/lifetime-sanitizer.c
> >>   cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
> >> Removed:
> >>   cfe/trunk/test/CodeGen/lifetime-asan.c
> >>   cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp
> >> 
> >> Removed: cfe/trunk/test/CodeGen/lifetime-asan.c
> >> URL: 
> >> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lifetime-asan.c?rev=369829=auto
> >>  
> >> 
> >> ==
> >> --- cfe/trunk/test/CodeGen/lifetime-asan.c (original)
> >> +++ cfe/trunk/test/CodeGen/lifetime-asan.c (removed)
> >> @@ -1,21 +0,0 @@
> >> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | 
> >> FileCheck %s -check-prefix=CHECK-O0
> >> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
> >> -// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
> >> -// RUN: FileCheck %s -check-prefix=CHECK-ASAN-USE-AFTER-SCOPE
> >> -
> >> -extern int bar(char *A, int n);
> >> -
> >> -// CHECK-O0-NOT: @llvm.lifetime.start
> >> -int foo(int n) {
> >> -  if (n) {
> >> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 10, i8* 
> >> {{.*}})
> >> -char A[10];
> >> -return bar(A, 1);
> >> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 10, i8* 
> >> {{.*}})
> >> -  } else {
> >> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 20, i8* 
> >> {{.*}})
> >> -char A[20];
> >> -return bar(A, 2);
> >> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 20, i8* 
> >> {{.*}})
> >> -  }
> >> -}
> >> 
> >> Added: cfe/trunk/test/CodeGen/lifetime-sanitizer.c
> >> URL: 
> >> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lifetime-sanitizer.c?rev=369830=auto
> >>  
> >> 
> >> ==
> >> --- cfe/trunk/test/CodeGen/lifetime-sanitizer.c (added)
> >> +++ cfe/trunk/test/CodeGen/lifetime-sanitizer.c Fri Aug 23 18:31:38 2019
> >> @@ -0,0 +1,21 @@
> >> +// RUN: 

Re: r369830 - NFC: Rename some sanitizer related lifetime checks

2019-08-24 Thread David Zarzycki via cfe-commits
Fix: r369843

Please confirm. Thanks!

> On Aug 24, 2019, at 8:18 AM, David Zarzycki  wrote:
> 
> This seems to have broken building on Red Hat Fedora Linux 30 (x86_64). Was 
> this expected?
> 
> FAIL: Clang :: CodeGenCXX/lifetime-sanitizer.cpp (7750 of 50751)
>  TEST 'Clang :: CodeGenCXX/lifetime-sanitizer.cpp' FAILED 
> 
> Script:
> --
> : 'RUN: at line 1';   /tmp/_update_lc/r/bin/clang -w -target x86_64-linux-gnu 
> -S -emit-llvm -o - -fno-exceptions -O0 
> /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp |   
> /tmp/_update_lc/r/bin/FileCheck 
> /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp 
> -check-prefixes=CHECK,CHECK-O0 --implicit-check-not=llvm.lifetime
> : 'RUN: at line 3';   /tmp/_update_lc/r/bin/clang -w -target x86_64-linux-gnu 
> -S -emit-llvm -o - -fno-exceptions -O0  -fsanitize=address 
> -fsanitize-address-use-after-scope 
> /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp |  
> /tmp/_update_lc/r/bin/FileCheck 
> /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp 
> -check-prefixes=CHECK,LIFETIME
> --
> Exit Code: 1
> 
> Command Output (stderr):
> --
> /home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp:30:18: error: 
> CHECK-LABEL: expected string not found in input
> // CHECK-LABEL: cond.true:
> ^
> :21:8: note: scanning from here
> br i1 %7, label %8, label %10
>   ^
> :25:6: note: possible intended match here
> store i1 true, i1* %4, align 1
> ^
> 
> 
> 
>> On Aug 24, 2019, at 2:31 AM, Vitaly Buka via cfe-commits 
>>  wrote:
>> 
>> Author: vitalybuka
>> Date: Fri Aug 23 18:31:38 2019
>> New Revision: 369830
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=369830=rev
>> Log:
>> NFC: Rename some sanitizer related lifetime checks
>> 
>> Added:
>>   cfe/trunk/test/CodeGen/lifetime-sanitizer.c
>>   cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
>> Removed:
>>   cfe/trunk/test/CodeGen/lifetime-asan.c
>>   cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp
>> 
>> Removed: cfe/trunk/test/CodeGen/lifetime-asan.c
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lifetime-asan.c?rev=369829=auto
>> ==
>> --- cfe/trunk/test/CodeGen/lifetime-asan.c (original)
>> +++ cfe/trunk/test/CodeGen/lifetime-asan.c (removed)
>> @@ -1,21 +0,0 @@
>> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | 
>> FileCheck %s -check-prefix=CHECK-O0
>> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
>> -// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
>> -// RUN: FileCheck %s -check-prefix=CHECK-ASAN-USE-AFTER-SCOPE
>> -
>> -extern int bar(char *A, int n);
>> -
>> -// CHECK-O0-NOT: @llvm.lifetime.start
>> -int foo(int n) {
>> -  if (n) {
>> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 10, i8* 
>> {{.*}})
>> -char A[10];
>> -return bar(A, 1);
>> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 10, i8* 
>> {{.*}})
>> -  } else {
>> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 20, i8* 
>> {{.*}})
>> -char A[20];
>> -return bar(A, 2);
>> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 20, i8* 
>> {{.*}})
>> -  }
>> -}
>> 
>> Added: cfe/trunk/test/CodeGen/lifetime-sanitizer.c
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lifetime-sanitizer.c?rev=369830=auto
>> ==
>> --- cfe/trunk/test/CodeGen/lifetime-sanitizer.c (added)
>> +++ cfe/trunk/test/CodeGen/lifetime-sanitizer.c Fri Aug 23 18:31:38 2019
>> @@ -0,0 +1,21 @@
>> +// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | 
>> FileCheck %s -check-prefix=CHECK-O0
>> +// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
>> +// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
>> +// RUN: FileCheck %s -check-prefix=LIFETIME
>> +
>> +extern int bar(char *A, int n);
>> +
>> +// CHECK-O0-NOT: @llvm.lifetime.start
>> +int foo(int n) {
>> +  if (n) {
>> +// LIFETIME: @llvm.lifetime.start.p0i8(i64 10, i8* {{.*}})
>> +char A[10];
>> +return bar(A, 1);
>> +// LIFETIME: @llvm.lifetime.end.p0i8(i64 10, i8* {{.*}})
>> +  } else {
>> +// LIFETIME: @llvm.lifetime.start.p0i8(i64 20, i8* {{.*}})
>> +char A[20];
>> +return bar(A, 2);
>> +// LIFETIME: @llvm.lifetime.end.p0i8(i64 20, i8* {{.*}})
>> +  }
>> +}
>> 
>> Removed: cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp?rev=369829=auto
>> ==
>> --- cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp (original)
>> +++ cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp (removed)
>> @@ -1,42 +0,0 @@
>> -// RUN: %clang -target x86_64-linux-gnu -S 

r369843 - [Testing] Unbreak r369830

2019-08-24 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Sat Aug 24 01:12:51 2019
New Revision: 369843

URL: http://llvm.org/viewvc/llvm-project?rev=369843=rev
Log:
[Testing] Unbreak r369830

Modified:
cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp

Modified: cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp?rev=369843=369842=369843=diff
==
--- cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp Sat Aug 24 01:12:51 2019
@@ -3,6 +3,7 @@
 // RUN: %clang -w -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions 
-O0 \
 // RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
 // RUN: FileCheck %s -check-prefixes=CHECK,LIFETIME
+// REQUIRES: assertions
 
 extern int bar(char *A, int n);
 


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


Re: r369830 - NFC: Rename some sanitizer related lifetime checks

2019-08-24 Thread David Zarzycki via cfe-commits
This seems to have broken building on Red Hat Fedora Linux 30 (x86_64). Was 
this expected?

FAIL: Clang :: CodeGenCXX/lifetime-sanitizer.cpp (7750 of 50751)
 TEST 'Clang :: CodeGenCXX/lifetime-sanitizer.cpp' FAILED 

Script:
--
: 'RUN: at line 1';   /tmp/_update_lc/r/bin/clang -w -target x86_64-linux-gnu 
-S -emit-llvm -o - -fno-exceptions -O0 
/home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp |   
/tmp/_update_lc/r/bin/FileCheck 
/home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp 
-check-prefixes=CHECK,CHECK-O0 --implicit-check-not=llvm.lifetime
: 'RUN: at line 3';   /tmp/_update_lc/r/bin/clang -w -target x86_64-linux-gnu 
-S -emit-llvm -o - -fno-exceptions -O0  -fsanitize=address 
-fsanitize-address-use-after-scope 
/home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp |  
/tmp/_update_lc/r/bin/FileCheck 
/home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp 
-check-prefixes=CHECK,LIFETIME
--
Exit Code: 1

Command Output (stderr):
--
/home/dave/s/lp/clang/test/CodeGenCXX/lifetime-sanitizer.cpp:30:18: error: 
CHECK-LABEL: expected string not found in input
 // CHECK-LABEL: cond.true:
 ^
:21:8: note: scanning from here
 br i1 %7, label %8, label %10
   ^
:25:6: note: possible intended match here
 store i1 true, i1* %4, align 1
 ^



> On Aug 24, 2019, at 2:31 AM, Vitaly Buka via cfe-commits 
>  wrote:
> 
> Author: vitalybuka
> Date: Fri Aug 23 18:31:38 2019
> New Revision: 369830
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=369830=rev
> Log:
> NFC: Rename some sanitizer related lifetime checks
> 
> Added:
>cfe/trunk/test/CodeGen/lifetime-sanitizer.c
>cfe/trunk/test/CodeGenCXX/lifetime-sanitizer.cpp
> Removed:
>cfe/trunk/test/CodeGen/lifetime-asan.c
>cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp
> 
> Removed: cfe/trunk/test/CodeGen/lifetime-asan.c
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lifetime-asan.c?rev=369829=auto
> ==
> --- cfe/trunk/test/CodeGen/lifetime-asan.c (original)
> +++ cfe/trunk/test/CodeGen/lifetime-asan.c (removed)
> @@ -1,21 +0,0 @@
> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | 
> FileCheck %s -check-prefix=CHECK-O0
> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
> -// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
> -// RUN: FileCheck %s -check-prefix=CHECK-ASAN-USE-AFTER-SCOPE
> -
> -extern int bar(char *A, int n);
> -
> -// CHECK-O0-NOT: @llvm.lifetime.start
> -int foo(int n) {
> -  if (n) {
> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 10, i8* 
> {{.*}})
> -char A[10];
> -return bar(A, 1);
> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 10, i8* 
> {{.*}})
> -  } else {
> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.start.p0i8(i64 20, i8* 
> {{.*}})
> -char A[20];
> -return bar(A, 2);
> -// CHECK-ASAN-USE-AFTER-SCOPE: @llvm.lifetime.end.p0i8(i64 20, i8* 
> {{.*}})
> -  }
> -}
> 
> Added: cfe/trunk/test/CodeGen/lifetime-sanitizer.c
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/lifetime-sanitizer.c?rev=369830=auto
> ==
> --- cfe/trunk/test/CodeGen/lifetime-sanitizer.c (added)
> +++ cfe/trunk/test/CodeGen/lifetime-sanitizer.c Fri Aug 23 18:31:38 2019
> @@ -0,0 +1,21 @@
> +// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | 
> FileCheck %s -check-prefix=CHECK-O0
> +// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
> +// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
> +// RUN: FileCheck %s -check-prefix=LIFETIME
> +
> +extern int bar(char *A, int n);
> +
> +// CHECK-O0-NOT: @llvm.lifetime.start
> +int foo(int n) {
> +  if (n) {
> +// LIFETIME: @llvm.lifetime.start.p0i8(i64 10, i8* {{.*}})
> +char A[10];
> +return bar(A, 1);
> +// LIFETIME: @llvm.lifetime.end.p0i8(i64 10, i8* {{.*}})
> +  } else {
> +// LIFETIME: @llvm.lifetime.start.p0i8(i64 20, i8* {{.*}})
> +char A[20];
> +return bar(A, 2);
> +// LIFETIME: @llvm.lifetime.end.p0i8(i64 20, i8* {{.*}})
> +  }
> +}
> 
> Removed: cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp?rev=369829=auto
> ==
> --- cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp (original)
> +++ cfe/trunk/test/CodeGenCXX/lifetime-asan.cpp (removed)
> @@ -1,42 +0,0 @@
> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions 
> -O0 %s | FileCheck %s -check-prefixes=CHECK,CHECK-O0 
> --implicit-check-not=llvm.lifetime
> -// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -fno-exceptions 
> -O0 \
> -// RUN: -fsanitize=address 

r369496 - [PPC Docs] Remove duplicate info about __builtin_setrnd()

2019-08-21 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Tue Aug 20 23:48:11 2019
New Revision: 369496

URL: http://llvm.org/viewvc/llvm-project?rev=369496=rev
Log:
[PPC Docs] Remove duplicate info about __builtin_setrnd()

This looks like a combination of a copy-and-paste (and paste and paste)
error and a commit without reviewing the diff first error.

Modified:
cfe/trunk/docs/LanguageExtensions.rst

Modified: cfe/trunk/docs/LanguageExtensions.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/LanguageExtensions.rst?rev=369496=369495=369496=diff
==
--- cfe/trunk/docs/LanguageExtensions.rst (original)
+++ cfe/trunk/docs/LanguageExtensions.rst Tue Aug 20 23:48:11 2019
@@ -2859,55 +2859,7 @@ PowerPC Language Extensions
 --
 
 Set the Floating Point Rounding Mode
-^^^
-PowerPC64/PowerPC64le supports the builtin function ``__builtin_setrnd`` to set
-the floating point rounding mode. This function will use the least significant
-two bits of integer argument to set the floating point rounding mode.
-
-.. code-block:: c++
-
-  double __builtin_setrnd(int mode);
-
-The effective values for mode are:
-
-- 0 - round to nearest
-- 1 - round to zero
-- 2 - round to +infinity
-- 3 - round to -infinity
-
-Note that the mode argument will modulo 4, so if the int argument is greater
-than 3, it will only use the least significant two bits of the mode.
-Namely, ``__builtin_setrnd(102))`` is equal to ``__builtin_setrnd(2)``.
-
-PowerPC Language Extensions
---
-
-Set the Floating Point Rounding Mode
-^^^
-PowerPC64/PowerPC64le supports the builtin function ``__builtin_setrnd`` to set
-the floating point rounding mode. This function will use the least significant
-two bits of integer argument to set the floating point rounding mode.
-
-.. code-block:: c++
-
-  double __builtin_setrnd(int mode);
-
-The effective values for mode are:
-
-- 0 - round to nearest
-- 1 - round to zero
-- 2 - round to +infinity
-- 3 - round to -infinity
-
-Note that the mode argument will modulo 4, so if the integer argument is 
greater
-than 3, it will only use the least significant two bits of the mode.
-Namely, ``__builtin_setrnd(102))`` is equal to ``__builtin_setrnd(2)``.
-
-PowerPC Language Extensions
---
-
-Set the Floating Point Rounding Mode
-^^^
+
 PowerPC64/PowerPC64le supports the builtin function ``__builtin_setrnd`` to set
 the floating point rounding mode. This function will use the least significant
 two bits of integer argument to set the floating point rounding mode.


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


r363916 - [Testing] Dumping the graph requires assertions be enabled

2019-06-20 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Thu Jun 20 02:58:58 2019
New Revision: 363916

URL: http://llvm.org/viewvc/llvm-project?rev=363916=rev
Log:
[Testing] Dumping the graph requires assertions be enabled

Modified:
cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c

Modified: cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c?rev=363916=363915=363916=diff
==
--- cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c (original)
+++ cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c Thu Jun 20 
02:58:58 2019
@@ -3,6 +3,7 @@
 // RUN: -analyzer-checker=core \
 // RUN: -analyzer-dump-egraph=%t.dot %s
 // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s
+// REQUIRES: asserts
 
 // FIXME: Substitution doesn't seem to work on Windows.
 // UNSUPPORTED: system-windows


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


r352996 - Hot fix two test regressions (%T vs %t)

2019-02-03 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Sun Feb  3 07:49:11 2019
New Revision: 352996

URL: http://llvm.org/viewvc/llvm-project?rev=352996=rev
Log:
Hot fix two test regressions (%T vs %t)

Different Unix "errno" values are returned for the following scenarios:

$ echo test > /tmp/existingFile/impossibleDir/impossibleFile
"Not a directory"
$ echo test > /tmp/nonexistentDir/impossibleFile
"No such file or directory"

This fixes the regression introduced by r352971 / D57592.

Modified:
cfe/trunk/test/Frontend/output-failures.c
cfe/trunk/test/Frontend/stats-file.c

Modified: cfe/trunk/test/Frontend/output-failures.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/output-failures.c?rev=352996=352995=352996=diff
==
--- cfe/trunk/test/Frontend/output-failures.c (original)
+++ cfe/trunk/test/Frontend/output-failures.c Sun Feb  3 07:49:11 2019
@@ -1,4 +1,4 @@
-// RUN: not %clang_cc1 -emit-llvm -o %t/doesnotexist/somename %s 2> %t
+// RUN: not %clang_cc1 -emit-llvm -o %t.doesnotexist/somename %s 2> %t
 // RUN: FileCheck -check-prefix=OUTPUTFAIL -input-file=%t %s
 
 // OUTPUTFAIL: error: unable to open output file 
'{{.*}}doesnotexist{{.}}somename': '{{[nN]}}o such file or directory'

Modified: cfe/trunk/test/Frontend/stats-file.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Frontend/stats-file.c?rev=352996=352995=352996=diff
==
--- cfe/trunk/test/Frontend/stats-file.c (original)
+++ cfe/trunk/test/Frontend/stats-file.c Sun Feb  3 07:49:11 2019
@@ -4,5 +4,5 @@
 //  ... here come some json values ...
 // CHECK: }
 
-// RUN: %clang_cc1 -emit-llvm -o %t -stats-file=%t/doesnotexist/bla %s 2>&1 | 
FileCheck -check-prefix=OUTPUTFAIL %s
+// RUN: %clang_cc1 -emit-llvm -o %t -stats-file=%t.doesnotexist/bla %s 2>&1 | 
FileCheck -check-prefix=OUTPUTFAIL %s
 // OUTPUTFAIL: warning: unable to open statistics output file 
'{{.*}}doesnotexist{{.}}bla': '{{[Nn]}}o such file or directory'


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


Re: r333874 - Reland "Move #include manipulation code to new lib/Tooling/Inclusions."

2018-06-04 Thread David Zarzycki via cfe-commits
Hi Roman – I agree that people shouldn’t need to manually fix this every time 
it happens.

Hi Nico – What is stopping the Chromium buildbots from setting 
BUILD_SHARED_LIBS to false? That way the default BUILD_SHARED_LIBS policy of 
llvm and/or clang doesn’t matter, right?

Dave


> On Jun 4, 2018, at 12:40 PM, Roman Lebedev  wrote:
> 
> This is n-th time i do this kind of fix.
> Sure this does resolve the issue, but it would be much better to use
> proper means,
> and tell people to fix their code, in an automatic way :)
> 
> On Mon, Jun 4, 2018 at 7:36 PM, Nico Weber  wrote:
>> All chromium bots build with asserts on and we definitely don't want shared
>> libs :-) Having the people who care about this build config make sure it
>> keeps working seems like a good approach to me.
>> 
>> On Mon, Jun 4, 2018 at 8:15 AM, David Zarzycki via cfe-commits
>>  wrote:
>>> 
>>> What’s stopping the project from automatically setting BUILD_SHARED_LIBS
>>> to TRUE if asserts are enabled? That’d automatically “force” active
>>> developers to test the scenario on their local machines, but not change the
>>> way release builds work.
>>> 
>>> 
>>>> On Jun 4, 2018, at 8:11 AM, Roman Lebedev via cfe-commits
>>>>  wrote:
>>>> 
>>>> This broke building as shared libraries.
>>>> 
>>>> I've committed the fix, but the bot coverage is clearly severely
>>>> missing,
>>>> given that such breakages are very often.
>>>> 
>>>> Roman.
>>>> 
>>>> On Mon, Jun 4, 2018 at 12:04 PM, Eric Liu via cfe-commits
>>>>  wrote:
>>>>> Author: ioeric
>>>>> Date: Mon Jun  4 02:04:12 2018
>>>>> New Revision: 333874
>>>>> 
>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=333874=rev
>>>>> Log:
>>>>> Reland "Move #include manipulation code to new lib/Tooling/Inclusions."
>>>>> 
>>>>> This reverts commit r333534 (i.e. reland r332720) after fixing module
>>>>> build.
>>>>> 
>>>>> Differential Revision: https://reviews.llvm.org/D47068
>>>>> 
>>>>> Added:
>>>>>   cfe/trunk/include/clang/Tooling/Inclusions/HeaderIncludes.h
>>>>> - copied, changed from r333865,
>>>>> cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
>>>>>   cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h
>>>>> - copied, changed from r333865,
>>>>> cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h
>>>>>   cfe/trunk/lib/Tooling/Inclusions/CMakeLists.txt
>>>>> - copied, changed from r333865,
>>>>> cfe/trunk/lib/Tooling/Core/CMakeLists.txt
>>>>>   cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp
>>>>> - copied, changed from r333865,
>>>>> cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp
>>>>>   cfe/trunk/lib/Tooling/Inclusions/IncludeStyle.cpp
>>>>> - copied, changed from r333865,
>>>>> cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp
>>>>> Removed:
>>>>>   cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
>>>>>   cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h
>>>>>   cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp
>>>>>   cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp
>>>>> Modified:
>>>>>   cfe/trunk/include/clang/Format/Format.h
>>>>>   cfe/trunk/include/clang/module.modulemap
>>>>>   cfe/trunk/lib/Format/CMakeLists.txt
>>>>>   cfe/trunk/lib/Format/Format.cpp
>>>>>   cfe/trunk/lib/Tooling/CMakeLists.txt
>>>>>   cfe/trunk/lib/Tooling/Core/CMakeLists.txt
>>>>>   cfe/trunk/unittests/Tooling/HeaderIncludesTest.cpp
>>>>> 
>>>>> Modified: cfe/trunk/include/clang/Format/Format.h
>>>>> URL:
>>>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=333874=333873=333874=diff
>>>>> 
>>>>> ==
>>>>> --- cfe/trunk/include/clang/Format/Format.h (original)
>>>>> +++ cfe/trunk/include/clang/Format/Format.h Mon Jun  4 02:04:12 2018
>>>>> @@ -16,8 +16,8 @@
>>>>> #define LLVM_CLANG_FORMAT_FORMAT_H
>&

Re: r333874 - Reland "Move #include manipulation code to new lib/Tooling/Inclusions."

2018-06-04 Thread David Zarzycki via cfe-commits
What’s stopping the project from automatically setting BUILD_SHARED_LIBS to 
TRUE if asserts are enabled? That’d automatically “force” active developers to 
test the scenario on their local machines, but not change the way release 
builds work.


> On Jun 4, 2018, at 8:11 AM, Roman Lebedev via cfe-commits 
>  wrote:
> 
> This broke building as shared libraries.
> 
> I've committed the fix, but the bot coverage is clearly severely missing,
> given that such breakages are very often.
> 
> Roman.
> 
> On Mon, Jun 4, 2018 at 12:04 PM, Eric Liu via cfe-commits
>  wrote:
>> Author: ioeric
>> Date: Mon Jun  4 02:04:12 2018
>> New Revision: 333874
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=333874=rev
>> Log:
>> Reland "Move #include manipulation code to new lib/Tooling/Inclusions."
>> 
>> This reverts commit r333534 (i.e. reland r332720) after fixing module build.
>> 
>> Differential Revision: https://reviews.llvm.org/D47068
>> 
>> Added:
>>cfe/trunk/include/clang/Tooling/Inclusions/HeaderIncludes.h
>>  - copied, changed from r333865, 
>> cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
>>cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h
>>  - copied, changed from r333865, 
>> cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h
>>cfe/trunk/lib/Tooling/Inclusions/CMakeLists.txt
>>  - copied, changed from r333865, 
>> cfe/trunk/lib/Tooling/Core/CMakeLists.txt
>>cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp
>>  - copied, changed from r333865, 
>> cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp
>>cfe/trunk/lib/Tooling/Inclusions/IncludeStyle.cpp
>>  - copied, changed from r333865, 
>> cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp
>> Removed:
>>cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
>>cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h
>>cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp
>>cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp
>> Modified:
>>cfe/trunk/include/clang/Format/Format.h
>>cfe/trunk/include/clang/module.modulemap
>>cfe/trunk/lib/Format/CMakeLists.txt
>>cfe/trunk/lib/Format/Format.cpp
>>cfe/trunk/lib/Tooling/CMakeLists.txt
>>cfe/trunk/lib/Tooling/Core/CMakeLists.txt
>>cfe/trunk/unittests/Tooling/HeaderIncludesTest.cpp
>> 
>> Modified: cfe/trunk/include/clang/Format/Format.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=333874=333873=333874=diff
>> ==
>> --- cfe/trunk/include/clang/Format/Format.h (original)
>> +++ cfe/trunk/include/clang/Format/Format.h Mon Jun  4 02:04:12 2018
>> @@ -16,8 +16,8 @@
>> #define LLVM_CLANG_FORMAT_FORMAT_H
>> 
>> #include "clang/Basic/LangOptions.h"
>> -#include "clang/Tooling/Core/IncludeStyle.h"
>> #include "clang/Tooling/Core/Replacement.h"
>> +#include "clang/Tooling/Inclusions/IncludeStyle.h"
>> #include "llvm/ADT/ArrayRef.h"
>> #include "llvm/Support/Regex.h"
>> #include 
>> 
>> Removed: cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h?rev=333873=auto
>> ==
>> --- cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h (original)
>> +++ cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h (removed)
>> @@ -1,137 +0,0 @@
>> -//===--- HeaderIncludes.h - Insert/Delete #includes for C++ code--*- 
>> C++-*-===//
>> -//
>> -// The LLVM Compiler Infrastructure
>> -//
>> -// This file is distributed under the University of Illinois Open Source
>> -// License. See LICENSE.TXT for details.
>> -//
>> -//===--===//
>> -
>> -#ifndef LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
>> -#define LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
>> -
>> -#include "clang/Basic/SourceManager.h"
>> -#include "clang/Tooling/Core/Replacement.h"
>> -#include "clang/Tooling/Core/IncludeStyle.h"
>> -#include "llvm/Support/Path.h"
>> -#include "llvm/Support/Regex.h"
>> -#include 
>> -
>> -namespace clang {
>> -namespace tooling {
>> -
>> -/// This class manages priorities of C++ #include categories and calculates
>> -/// priorities for headers.
>> -/// FIXME(ioeric): move this class into implementation file when 
>> clang-format's
>> -/// include sorting functions are also moved here.
>> -class IncludeCategoryManager {
>> -public:
>> -  IncludeCategoryManager(const IncludeStyle , StringRef FileName);
>> -
>> -  /// Returns the priority of the category which \p IncludeName belongs to.
>> -  /// If \p CheckMainHeader is true and \p IncludeName is a main header, 
>> returns
>> -  /// 0. Otherwise, returns the priority of the matching category or 
>> INT_MAX.
>> -  /// NOTE: this API is not thread-safe!
>> -  int getIncludePriority(StringRef IncludeName, bool CheckMainHeader) const;
>> -
>> -private:
>> -  bool 

Re: r333874 - Reland "Move #include manipulation code to new lib/Tooling/Inclusions."

2018-06-04 Thread David Zarzycki via cfe-commits
FYI – This broke `cmake -DBUILD_SHARED_LIBS=TRUE` builds.


> On Jun 4, 2018, at 5:04 AM, Eric Liu via cfe-commits 
>  wrote:
> 
> Author: ioeric
> Date: Mon Jun  4 02:04:12 2018
> New Revision: 333874
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=333874=rev
> Log:
> Reland "Move #include manipulation code to new lib/Tooling/Inclusions."
> 
> This reverts commit r333534 (i.e. reland r332720) after fixing module build.
> 
> Differential Revision: https://reviews.llvm.org/D47068
> 
> Added:
>cfe/trunk/include/clang/Tooling/Inclusions/HeaderIncludes.h
>  - copied, changed from r333865, 
> cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
>cfe/trunk/include/clang/Tooling/Inclusions/IncludeStyle.h
>  - copied, changed from r333865, 
> cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h
>cfe/trunk/lib/Tooling/Inclusions/CMakeLists.txt
>  - copied, changed from r333865, cfe/trunk/lib/Tooling/Core/CMakeLists.txt
>cfe/trunk/lib/Tooling/Inclusions/HeaderIncludes.cpp
>  - copied, changed from r333865, 
> cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp
>cfe/trunk/lib/Tooling/Inclusions/IncludeStyle.cpp
>  - copied, changed from r333865, 
> cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp
> Removed:
>cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
>cfe/trunk/include/clang/Tooling/Core/IncludeStyle.h
>cfe/trunk/lib/Tooling/Core/HeaderIncludes.cpp
>cfe/trunk/lib/Tooling/Core/IncludeStyle.cpp
> Modified:
>cfe/trunk/include/clang/Format/Format.h
>cfe/trunk/include/clang/module.modulemap
>cfe/trunk/lib/Format/CMakeLists.txt
>cfe/trunk/lib/Format/Format.cpp
>cfe/trunk/lib/Tooling/CMakeLists.txt
>cfe/trunk/lib/Tooling/Core/CMakeLists.txt
>cfe/trunk/unittests/Tooling/HeaderIncludesTest.cpp
> 
> Modified: cfe/trunk/include/clang/Format/Format.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=333874=333873=333874=diff
> ==
> --- cfe/trunk/include/clang/Format/Format.h (original)
> +++ cfe/trunk/include/clang/Format/Format.h Mon Jun  4 02:04:12 2018
> @@ -16,8 +16,8 @@
> #define LLVM_CLANG_FORMAT_FORMAT_H
> 
> #include "clang/Basic/LangOptions.h"
> -#include "clang/Tooling/Core/IncludeStyle.h"
> #include "clang/Tooling/Core/Replacement.h"
> +#include "clang/Tooling/Inclusions/IncludeStyle.h"
> #include "llvm/ADT/ArrayRef.h"
> #include "llvm/Support/Regex.h"
> #include 
> 
> Removed: cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h?rev=333873=auto
> ==
> --- cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h (original)
> +++ cfe/trunk/include/clang/Tooling/Core/HeaderIncludes.h (removed)
> @@ -1,137 +0,0 @@
> -//===--- HeaderIncludes.h - Insert/Delete #includes for C++ code--*- 
> C++-*-===//
> -//
> -// The LLVM Compiler Infrastructure
> -//
> -// This file is distributed under the University of Illinois Open Source
> -// License. See LICENSE.TXT for details.
> -//
> -//===--===//
> -
> -#ifndef LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
> -#define LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
> -
> -#include "clang/Basic/SourceManager.h"
> -#include "clang/Tooling/Core/Replacement.h"
> -#include "clang/Tooling/Core/IncludeStyle.h"
> -#include "llvm/Support/Path.h"
> -#include "llvm/Support/Regex.h"
> -#include 
> -
> -namespace clang {
> -namespace tooling {
> -
> -/// This class manages priorities of C++ #include categories and calculates
> -/// priorities for headers.
> -/// FIXME(ioeric): move this class into implementation file when 
> clang-format's
> -/// include sorting functions are also moved here.
> -class IncludeCategoryManager {
> -public:
> -  IncludeCategoryManager(const IncludeStyle , StringRef FileName);
> -
> -  /// Returns the priority of the category which \p IncludeName belongs to.
> -  /// If \p CheckMainHeader is true and \p IncludeName is a main header, 
> returns
> -  /// 0. Otherwise, returns the priority of the matching category or INT_MAX.
> -  /// NOTE: this API is not thread-safe!
> -  int getIncludePriority(StringRef IncludeName, bool CheckMainHeader) const;
> -
> -private:
> -  bool isMainHeader(StringRef IncludeName) const;
> -
> -  const IncludeStyle Style;
> -  bool IsMainFile;
> -  std::string FileName;
> -  // This refers to a substring in FileName.
> -  StringRef FileStem;
> -  // Regex is not thread-safe.
> -  mutable SmallVector CategoryRegexs;
> -};
> -
> -/// Generates replacements for inserting or deleting #include directives in a
> -/// file.
> -class HeaderIncludes {
> -public:
> -  HeaderIncludes(llvm::StringRef FileName, llvm::StringRef Code,
> - const IncludeStyle );
> -
> -  /// Inserts an #include 

Re: r332436 - clang-format: Allow optimizer to break template declaration.

2018-05-16 Thread David Zarzycki via cfe-commits
This change broke `test/Index/overriding-ftemplate-comments.cpp` on Red Hat 
Fedora 28. Was this expected?

> On May 16, 2018, at 4:25 AM, Francois Ferrand via cfe-commits 
>  wrote:
> 
> Author: typz
> Date: Wed May 16 01:25:03 2018
> New Revision: 332436
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=332436=rev
> Log:
> clang-format: Allow optimizer to break template declaration.
> 
> Summary:
> Introduce `PenaltyBreakTemplateDeclaration` to control the penalty,
> and change `AlwaysBreakTemplateDeclarations` to an enum with 3 modes:
> * `No` for regular, penalty based, wrapping of template declaration
> * `MultiLine` for always wrapping before multi-line declarations (e.g.
>  same as legacy behavior when `AlwaysBreakTemplateDeclarations=false`)
> * `Yes` for always wrapping (e.g. same as legacy behavior when
>  `AlwaysBreakTemplateDeclarations=true`)
> 
> Reviewers: krasimir, djasper, klimek
> 
> Subscribers: cfe-commits
> 
> Differential Revision: https://reviews.llvm.org/D42684
> 
> Modified:
>cfe/trunk/docs/ClangFormatStyleOptions.rst
>cfe/trunk/include/clang/Format/Format.h
>cfe/trunk/lib/Format/ContinuationIndenter.cpp
>cfe/trunk/lib/Format/Format.cpp
>cfe/trunk/lib/Format/TokenAnnotator.cpp
>cfe/trunk/unittests/Format/FormatTest.cpp
> 
> Modified: cfe/trunk/docs/ClangFormatStyleOptions.rst
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/ClangFormatStyleOptions.rst?rev=332436=332435=332436=diff
> ==
> --- cfe/trunk/docs/ClangFormatStyleOptions.rst (original)
> +++ cfe/trunk/docs/ClangFormatStyleOptions.rst Wed May 16 01:25:03 2018
> @@ -490,15 +490,50 @@ the configuration (without a prefix: ``A
>  """";
>  "";
> 
> -**AlwaysBreakTemplateDeclarations** (``bool``)
> -  If ``true``, always break after the ``template<...>`` of a template
> -  declaration.
> +**AlwaysBreakTemplateDeclarations** (``BreakTemplateDeclarationsStyle``)
> +  The template declaration breaking style to use.
> +
> +  Possible values:
> +
> +  * ``BTDS_No`` (in configuration: ``No``)
> +Do not force break before declaration.
> +``PenaltyBreakTemplateDeclaration`` is taken into account.
> +
> +.. code-block:: c++
> +
> +   template  T foo() {
> +   }
> +   template  T foo(int a,
> +   int b) {
> +   }
> +
> +  * ``BTDS_MultiLine`` (in configuration: ``MultiLine``)
> +Force break after template declaration only when the following
> +declaration spans multiple lines.
> +
> +.. code-block:: c++
> +
> +   template  T foo() {
> +   }
> +   template 
> +   T foo(int a,
> + int b) {
> +   }
> +
> +  * ``BTDS_Yes`` (in configuration: ``Yes``)
> +Always break after template declaration.
> +
> +.. code-block:: c++
> +
> +   template 
> +   T foo() {
> +   }
> +   template 
> +   T foo(int a,
> + int b) {
> +   }
> 
> -  .. code-block:: c++
> 
> - true:  false:
> - template   vs. template  class C {};
> - class C {};
> 
> **BinPackArguments** (``bool``)
>   If ``false``, a function call's arguments will either be all on the
> @@ -1590,6 +1625,9 @@ the configuration (without a prefix: ``A
> **PenaltyBreakString** (``unsigned``)
>   The penalty for each line break introduced inside a string literal.
> 
> +**PenaltyBreakTemplateDeclaration** (``unsigned``)
> +  The penalty for breaking after template declaration.
> +
> **PenaltyExcessCharacter** (``unsigned``)
>   The penalty for each character outside of the column limit.
> 
> 
> Modified: cfe/trunk/include/clang/Format/Format.h
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?rev=332436=332435=332436=diff
> ==
> --- cfe/trunk/include/clang/Format/Format.h (original)
> +++ cfe/trunk/include/clang/Format/Format.h Wed May 16 01:25:03 2018
> @@ -351,14 +351,44 @@ struct FormatStyle {
>   /// \endcode
>   bool AlwaysBreakBeforeMultilineStrings;
> 
> -  /// If ``true``, always break after the ``template<...>`` of a template
> -  /// declaration.
> -  /// \code
> -  ///true:  false:
> -  ///template   vs. template  class 
> C {};
> -  ///class C {};
> -  /// \endcode
> -  bool AlwaysBreakTemplateDeclarations;
> +  /// Different ways to break after the template declaration.
> +  enum BreakTemplateDeclarationsStyle {
> +  /// Do not force break before declaration.
> +  /// ``PenaltyBreakTemplateDeclaration`` is taken into account.
> +  /// \code
> +  ///template  T foo() {
> +  ///}
> + 

r330353 - [UnitTests] NFC/build-perf: Break up nontrivial compile jobs

2018-04-19 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Thu Apr 19 11:19:02 2018
New Revision: 330353

URL: http://llvm.org/viewvc/llvm-project?rev=330353=rev
Log:
[UnitTests] NFC/build-perf: Break up nontrivial compile jobs

RecursiveASTVisitorTest.cpp is one of the longest compile jobs and a
build bottleneck on many-core machines. This patch breaks that file and
some peer files up into smaller files to increase build concurrency and
overall rebuild performance.

Added:
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/Attr.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/CXXBoolLiteralExpr.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/CXXMemberCall.cpp
  - copied, changed from r330338, 
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTestCallVisitor.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/CXXOperatorCallExprTraverser.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/Class.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/ConstructExpr.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/DeclRefExpr.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/ImplicitCtor.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/InitListExprPostOrder.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/InitListExprPostOrderNoQueue.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/InitListExprPreOrder.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/InitListExprPreOrderNoQueue.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/IntegerLiteral.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/LambdaDefaultCapture.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/LambdaExpr.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/NestedNameSpecifiers.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/ParenExpr.cpp

cfe/trunk/unittests/Tooling/RecursiveASTVisitorTests/TemplateArgumentLocTraverser.cpp
Removed:
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTestCallVisitor.cpp
cfe/trunk/unittests/Tooling/RecursiveASTVisitorTestExprVisitor.cpp
Modified:
cfe/trunk/unittests/Tooling/CMakeLists.txt

Modified: cfe/trunk/unittests/Tooling/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/CMakeLists.txt?rev=330353=330352=330353=diff
==
--- cfe/trunk/unittests/Tooling/CMakeLists.txt (original)
+++ cfe/trunk/unittests/Tooling/CMakeLists.txt Thu Apr 19 11:19:02 2018
@@ -21,10 +21,25 @@ add_clang_unittest(ToolingTests
   LexicallyOrderedRecursiveASTVisitorTest.cpp
   LookupTest.cpp
   QualTypeNamesTest.cpp
-  RecursiveASTVisitorTest.cpp
-  RecursiveASTVisitorTestCallVisitor.cpp
+  RecursiveASTVisitorTests/Attr.cpp
+  RecursiveASTVisitorTests/Class.cpp
+  RecursiveASTVisitorTests/ConstructExpr.cpp
+  RecursiveASTVisitorTests/CXXBoolLiteralExpr.cpp
+  RecursiveASTVisitorTests/CXXMemberCall.cpp
+  RecursiveASTVisitorTests/CXXOperatorCallExprTraverser.cpp
+  RecursiveASTVisitorTests/DeclRefExpr.cpp
+  RecursiveASTVisitorTests/ImplicitCtor.cpp
+  RecursiveASTVisitorTests/InitListExprPostOrder.cpp
+  RecursiveASTVisitorTests/InitListExprPostOrderNoQueue.cpp
+  RecursiveASTVisitorTests/InitListExprPreOrder.cpp
+  RecursiveASTVisitorTests/InitListExprPreOrderNoQueue.cpp
+  RecursiveASTVisitorTests/IntegerLiteral.cpp
+  RecursiveASTVisitorTests/LambdaDefaultCapture.cpp
+  RecursiveASTVisitorTests/LambdaExpr.cpp
+  RecursiveASTVisitorTests/NestedNameSpecifiers.cpp
+  RecursiveASTVisitorTests/ParenExpr.cpp
+  RecursiveASTVisitorTests/TemplateArgumentLocTraverser.cpp
   RecursiveASTVisitorTestDeclVisitor.cpp
-  RecursiveASTVisitorTestExprVisitor.cpp
   RecursiveASTVisitorTestPostOrderVisitor.cpp
   RecursiveASTVisitorTestTypeLocVisitor.cpp
   RefactoringActionRulesTest.cpp

Removed: cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp?rev=330352=auto
==
--- cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp (original)
+++ cfe/trunk/unittests/Tooling/RecursiveASTVisitorTest.cpp (removed)
@@ -1,305 +0,0 @@
-//===- unittest/Tooling/RecursiveASTVisitorTest.cpp 
---===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===--===//
-
-#include "TestVisitor.h"
-#include 
-
-using namespace clang;
-
-namespace {
-
-class LambdaExprVisitor : public ExpectedLocationVisitor {
-public:
-  bool VisitLambdaExpr(LambdaExpr *Lambda) {
-

r326110 - Fix for LLVM r326109

2018-02-27 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Mon Feb 26 10:42:30 2018
New Revision: 326110

URL: http://llvm.org/viewvc/llvm-project?rev=326110=rev
Log:
Fix for LLVM r326109

Modified:
cfe/trunk/lib/Basic/SourceManager.cpp

Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=326110=326109=326110=diff
==
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Mon Feb 26 10:42:30 2018
@@ -170,8 +170,10 @@ llvm::MemoryBuffer *ContentCache::getBuf
   const char *InvalidBOM = llvm::StringSwitch(BufStr)
 .StartsWith("\xFE\xFF", "UTF-16 (BE)")
 .StartsWith("\xFF\xFE", "UTF-16 (LE)")
-.StartsWith("\x00\x00\xFE\xFF", "UTF-32 (BE)")
-.StartsWith("\xFF\xFE\x00\x00", "UTF-32 (LE)")
+.StartsWith(llvm::StringLiteral::withInnerNUL("\x00\x00\xFE\xFF"),
+  "UTF-32 (BE)")
+.StartsWith(llvm::StringLiteral::withInnerNUL("\xFF\xFE\x00\x00"),
+  "UTF-32 (LE)")
 .StartsWith("\x2B\x2F\x76", "UTF-7")
 .StartsWith("\xF7\x64\x4C", "UTF-1")
 .StartsWith("\xDD\x73\x66\x73", "UTF-EBCDIC")


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


[clang-tools-extra] r326118 - Fix for LLVM r326109

2018-02-26 Thread David Zarzycki via cfe-commits
Author: davezarzycki
Date: Mon Feb 26 12:21:30 2018
New Revision: 326118

URL: http://llvm.org/viewvc/llvm-project?rev=326118=rev
Log:
Fix for LLVM r326109

Modified:
clang-tools-extra/trunk/clang-query/QueryParser.cpp
clang-tools-extra/trunk/clang-query/QueryParser.h

Modified: clang-tools-extra/trunk/clang-query/QueryParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-query/QueryParser.cpp?rev=326118=326117=326118=diff
==
--- clang-tools-extra/trunk/clang-query/QueryParser.cpp (original)
+++ clang-tools-extra/trunk/clang-query/QueryParser.cpp Mon Feb 26 12:21:30 2018
@@ -50,25 +50,35 @@ StringRef QueryParser::lexWord() {
 // This is the StringSwitch-alike used by lexOrCompleteWord below. See that
 // function for details.
 template  struct QueryParser::LexOrCompleteWord {
+  StringRef Word;
   StringSwitch Switch;
 
   QueryParser *P;
-  StringRef Word;
   // Set to the completion point offset in Word, or StringRef::npos if
   // completion point not in Word.
   size_t WordCompletionPos;
 
-  LexOrCompleteWord(QueryParser *P, StringRef Word, size_t WCP)
-  : Switch(Word), P(P), Word(Word), WordCompletionPos(WCP) {}
+  // Lexes a word and stores it in Word. Returns a LexOrCompleteWord object
+  // that can be used like a llvm::StringSwitch, but adds cases as possible
+  // completions if the lexed word contains the completion point.
+  LexOrCompleteWord(QueryParser *P, StringRef )
+  : Word(P->lexWord()), Switch(Word), P(P),
+WordCompletionPos(StringRef::npos) {
+OutWord = Word;
+if (P->CompletionPos && P->CompletionPos <= Word.data() + Word.size()) {
+  if (P->CompletionPos < Word.data())
+WordCompletionPos = 0;
+  else
+WordCompletionPos = P->CompletionPos - Word.data();
+}
+  }
 
-  template 
-  LexOrCompleteWord (const char ()[N], const T ,
+  LexOrCompleteWord (llvm::StringLiteral CaseStr, const T ,
   bool IsCompletion = true) {
-StringRef CaseStr(S, N - 1);
 
 if (WordCompletionPos == StringRef::npos)
-  Switch.Case(S, Value);
-else if (N != 1 && IsCompletion && WordCompletionPos <= CaseStr.size() &&
+  Switch.Case(CaseStr, Value);
+else if (CaseStr.size() != 0 && IsCompletion && WordCompletionPos <= 
CaseStr.size() &&
  CaseStr.substr(0, WordCompletionPos) ==
  Word.substr(0, WordCompletionPos))
   P->Completions.push_back(LineEditor::Completion(
@@ -76,29 +86,12 @@ template  struct QueryParser
 return *this;
   }
 
-  T Default(const T ) const { return Switch.Default(Value); }
+  T Default(T Value) { return Switch.Default(Value); }
 };
 
-// Lexes a word and stores it in Word. Returns a LexOrCompleteWord object
-// that can be used like a llvm::StringSwitch, but adds cases as possible
-// completions if the lexed word contains the completion point.
-template 
-QueryParser::LexOrCompleteWord
-QueryParser::lexOrCompleteWord(StringRef ) {
-  Word = lexWord();
-  size_t WordCompletionPos = StringRef::npos;
-  if (CompletionPos && CompletionPos <= Word.data() + Word.size()) {
-if (CompletionPos < Word.data())
-  WordCompletionPos = 0;
-else
-  WordCompletionPos = CompletionPos - Word.data();
-  }
-  return LexOrCompleteWord(this, Word, WordCompletionPos);
-}
-
 QueryRef QueryParser::parseSetBool(bool QuerySession::*Var) {
   StringRef ValStr;
-  unsigned Value = lexOrCompleteWord(ValStr)
+  unsigned Value = LexOrCompleteWord(this, ValStr)
.Case("false", 0)
.Case("true", 1)
.Default(~0u);
@@ -110,7 +103,7 @@ QueryRef QueryParser::parseSetBool(bool
 
 QueryRef QueryParser::parseSetOutputKind() {
   StringRef ValStr;
-  unsigned OutKind = lexOrCompleteWord(ValStr)
+  unsigned OutKind = LexOrCompleteWord(this, ValStr)
  .Case("diag", OK_Diag)
  .Case("print", OK_Print)
  .Case("dump", OK_Dump)
@@ -166,7 +159,7 @@ QueryRef QueryParser::completeMatcherExp
 
 QueryRef QueryParser::doParse() {
   StringRef CommandStr;
-  ParsedQueryKind QKind = lexOrCompleteWord(CommandStr)
+  ParsedQueryKind QKind = LexOrCompleteWord(this, CommandStr)
   .Case("", PQK_NoOp)
   .Case("help", PQK_Help)
   .Case("m", PQK_Match, /*IsCompletion=*/false)
@@ -221,7 +214,8 @@ QueryRef QueryParser::doParse() {
 
   case PQK_Set: {
 StringRef VarStr;
-ParsedQueryVariable Var = lexOrCompleteWord(VarStr)
+ParsedQueryVariable Var = LexOrCompleteWord(this,
+ VarStr)
   .Case("output", PQV_Output)
   .Case("bind-root", PQV_BindRoot)
   .Default(PQV_Invalid);

Modified: