r294522 - [sancov] pc_guard_init is called at least once per DSO.

2017-02-08 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Wed Feb  8 15:28:39 2017
New Revision: 294522

URL: http://llvm.org/viewvc/llvm-project?rev=294522=rev
Log:
[sancov] pc_guard_init is called at least once per DSO.

Summary: Documentation update for https://reviews.llvm.org/D29662

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

Modified:
cfe/trunk/docs/SanitizerCoverage.rst

Modified: cfe/trunk/docs/SanitizerCoverage.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SanitizerCoverage.rst?rev=294522=294521=294522=diff
==
--- cfe/trunk/docs/SanitizerCoverage.rst (original)
+++ cfe/trunk/docs/SanitizerCoverage.rst Wed Feb  8 15:28:39 2017
@@ -355,7 +355,8 @@ The compler will also insert a module co
 .. code-block:: c++
 
// The guards are [start, stop).
-   // This function may be called multiple times with the same values of 
start/stop.
+   // This function will be called at least once per DSO and may be called
+   // more than once with the same values of start/stop.
__sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop);
 
 With `trace-pc-guards,indirect-calls`
@@ -373,10 +374,10 @@ Example:
   #include 
 
   // This callback is inserted by the compiler as a module constructor
-  // into every compilation unit. 'start' and 'stop' correspond to the
+  // into every DSO. 'start' and 'stop' correspond to the
   // beginning and end of the section with the guards for the entire
-  // binary (executable or DSO) and so it will be called multiple times
-  // with the same parameters.
+  // binary (executable or DSO). The callback will be called at least
+  // once per DSO and may be called multiple times with the same parameters.
   extern "C" void __sanitizer_cov_trace_pc_guard_init(uint32_t *start,
   uint32_t *stop) {
 static uint64_t N;  // Counter for the guards.


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


Re: r289754 - [c++1z] Permit constant evaluation of a call through a function pointer whose

2016-12-19 Thread Mike Aizatsky via cfe-commits
Richard,

Clang crashes for me on this code while doing "check-all". This change
seems to introduce the assert. Can you take a look?

BTW I'm not sure why bots are green. Do we build libcxx with bootstrap
compiler?


FAIL: libc++ ::
std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp
(34988 of 39764)
 TEST 'libc++ ::
std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp'
FAILED 
Command: ['/usr/local/google/home/aizatsky/out/llvm/bootstrap/bin/clang++',
'-o',
'/usr/local/google/home/aizatsky/out/llvm/default/projects/libcxx/test/std/experimental/string.view/string.view.find/Output/find
_last_of_pointer_size_size.pass.cpp.o', '-x', 'c++',
'/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/std/experimental/string.view/string.view.find/find_last_of_pointer_size_size.pass.cpp',
'-c',
'-v', '-Werror=thread-safety', '-std=c++1z', '-include',
'/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/support/nasty_macros.hpp',
'-nostdinc++', '-I/usr/local/google/home/aizatsky/src/llvm/proj
ects/libcxx/include', '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS',
'-D__STDC_CONSTANT_MACROS',
'-I/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/support',
'-DLIBCXX_FILESYSTEM_STATIC_TEST_R
OOT="/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/std/experimental/filesystem/Inputs/static_test_env"',
'-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT="/usr/local/google/home/aizatsky/out/llvm/default/
projects/libcxx/test/filesystem/Output/dynamic_env"',
'-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER="/usr/bin/python2.7
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/support/filesystem_dynamic_test_h
elper.py"', '-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', '-Wextra',
'-Werror', '-Wshadow', '-Wshadow', '-Wno-unused-command-line-argument',
'-Wno-attributes', '-Wno-pessimizing-move', '-Wno-c++11-extension
s', '-Wno-user-defined-literals', '-Wno-sign-compare',
'-Wno-unused-variable', '-Wno-unused-parameter',
'-Wno-unused-local-typedef', '-c']
Exit Code: 254
Standard Error:
--
clang version 4.0.0 (trunk 290130) (llvm/trunk 290127)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/google/home/aizatsky/out/llvm/bootstrap/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
 "/usr/local/google/home/aizatsky/out/llvm/bootstrap/bin/clang-3.8" -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name find_last_of_pointer_size_size.pass.cpp -mrelocation
-model static -mthread-model posix -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu x86-64 -v -dwarf-column-info -debugger-tuning=gdb -coverage-not
es-file
/usr/local/google/home/aizatsky/out/llvm/default/projects/libcxx/test/std/experimental/string.view/string.view.find/Output/find_last_of_pointer_size_size.pass.cpp.gcno
-nostdinc++ -resource-dir /usr/loc
al/google/home/aizatsky/out/llvm/bootstrap/bin/../lib/clang/4.0.0 -include
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/support/nasty_macros.hpp
-I /usr/local/google/home/aizatsky/src/llvm/proj
ects/libcxx/include -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -D
__STDC_CONSTANT_MACROS -I
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/support -D
"LIBCXX_FILESYSTEM_STATIC_TEST_ROOT=\"/us
r/local/google/home/aizatsky/src/llvm/projects/libcxx/test/std/experimental/filesystem/Inputs/static_test_env\""
-D
"LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT=\"/usr/local/google/home/aizatsky/out/llvm/default/projec
ts/libcxx/test/filesystem/Output/dynamic_env\"" -D
"LIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER=\"/usr/bin/python2.7
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/test/support/filesystem_dynamic_test_helpe
r.py\"" -D _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -internal-isystem
/usr/local/include -internal-isystem
/usr/local/google/home/aizatsky/out/llvm/bootstrap/bin/../lib/clang/4.0.0/include
-internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Werror=thread-safety -Wall -Wextra

r289144 - [sanitizers] lsan+sancov doesn't need ubsanrt (multi def error)

2016-12-08 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Thu Dec  8 16:25:01 2016
New Revision: 289144

URL: http://llvm.org/viewvc/llvm-project?rev=289144=rev
Log:
[sanitizers] lsan+sancov doesn't need ubsanrt (multi def error)

Reviewers: eugenis

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

Modified:
cfe/trunk/lib/Driver/SanitizerArgs.cpp
cfe/trunk/test/Driver/sanitizer-ld.c

Modified: cfe/trunk/lib/Driver/SanitizerArgs.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/SanitizerArgs.cpp?rev=289144=289143=289144=diff
==
--- cfe/trunk/lib/Driver/SanitizerArgs.cpp (original)
+++ cfe/trunk/lib/Driver/SanitizerArgs.cpp Thu Dec  8 16:25:01 2016
@@ -165,7 +165,8 @@ bool SanitizerArgs::needsUbsanRt() const
   return ((Sanitizers.Mask & NeedsUbsanRt & ~TrapSanitizers.Mask) ||
   CoverageFeatures) &&
  !Sanitizers.has(Address) && !Sanitizers.has(Memory) &&
- !Sanitizers.has(Thread) && !Sanitizers.has(DataFlow) && !CfiCrossDso;
+ !Sanitizers.has(Thread) && !Sanitizers.has(DataFlow) && 
+ !Sanitizers.has(Leak) && !CfiCrossDso;
 }
 
 bool SanitizerArgs::needsCfiRt() const {

Modified: cfe/trunk/test/Driver/sanitizer-ld.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/sanitizer-ld.c?rev=289144=289143=289144=diff
==
--- cfe/trunk/test/Driver/sanitizer-ld.c (original)
+++ cfe/trunk/test/Driver/sanitizer-ld.c Thu Dec  8 16:25:01 2016
@@ -289,10 +289,24 @@
 //
 // CHECK-LSAN-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
 // CHECK-LSAN-LINUX-NOT: "-lc"
+// CHECK-LSAN-LINUX-NOT: libclang_rt.ubsan
 // CHECK-LSAN-LINUX: libclang_rt.lsan-x86_64.a"
 // CHECK-LSAN-LINUX: "-lpthread"
 // CHECK-LSAN-LINUX: "-ldl"
 
+// RUN: %clang -no-canonical-prefixes %s -### -o %t.o 2>&1 \
+// RUN:  -target x86_64-unknown-linux -fsanitize=leak -fsanitize-coverage=func 
\
+// RUN:  --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-LSAN-COV-LINUX %s
+//
+// CHECK-LSAN-COV-LINUX: "{{(.*[^-.0-9A-Z_a-z])?}}ld{{(.exe)?}}"
+// CHECK-LSAN-COV-LINUX-NOT: "-lc"
+// CHECK-LSAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-LSAV-COV-LINUX: libclang_rt.lsan-x86_64.a"
+// CHECK-LSAN-COV-LINUX-NOT: libclang_rt.ubsan
+// CHECK-LSAN-COV-LINUX: "-lpthread"
+// CHECK-LSAN-COV-LINUX: "-ldl"
+
 // RUN: %clang -fsanitize=leak,address %s -### -o %t.o 2>&1 \
 // RUN: -target x86_64-unknown-linux \
 // RUN: --sysroot=%S/Inputs/basic_linux_tree \


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


Re: r284685 - Refactor and simplify Sema::FindCompositePointerType. No functionality change intended.

2016-10-20 Thread Mike Aizatsky via cfe-commits
I think this breaks windows bot:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/30745/steps/build%20clang%20lld/logs/stdio

C:\PROGRA~2\MICROS~1.0\VC\bin\AMD64_~2\cl.exe   /nologo /TP
-DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER
-DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -DUNICODE
-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GNU_SOURCE
-D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE
-D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\clang\lib\Sema
-IC:\b\slave\sanitizer-windows\llvm\tools\clang\lib\Sema
-IC:\b\slave\sanitizer-windows\llvm\tools\clang\include
-Itools\clang\include -Iinclude
-IC:\b\slave\sanitizer-windows\llvm\include /DWIN32 /D_WINDOWS   /W4
-wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345
-wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624
-wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510
-wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611
-wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062
-we4238 /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast
/Zc:sizedDealloc- /MD /O2 /Ob2   -UNDEBUG  /EHs-c- /GR- /showIncludes
/Fotools\clang\lib\Sema\CMakeFiles\clangSema.dir\SemaExprCXX.cpp.obj
/Fdtools\clang\lib\Sema\CMakeFiles\clangSema.dir\ /FS -c
C:\b\slave\sanitizer-windows\llvm\tools\clang\lib\Sema\SemaExprCXX.cpp
C:\b\slave\sanitizer-windows\llvm\tools\clang\lib\Sema\SemaExprCXX.cpp(5702):
error C2326: 
'clang::Sema::FindCompositePointerType::Conversion::Conversion(clang::Sema
&,clang::SourceLocation,clang::Expr *&,clang::Expr
*&,clang::QualType)': function cannot access 'Composite'
C:\b\slave\sanitizer-windows\llvm\tools\clang\lib\Sema\SemaExprCXX.cpp(5702):
error C2248: 'clang::InitializedEntity::InitializedEntity': cannot
access private member declared in class 'clang::InitializedEntity'
C:\b\slave\sanitizer-windows\llvm\tools\clang\include\clang/Sema/Initialization.h(163):
note: see declaration of 'clang::InitializedEntity::InitializedEntity'
C:\b\slave\sanitizer-windows\llvm\tools\clang\include\clang/Sema/Initialization.h(40):
note: see declaration of 'clang::InitializedEntity'
C:\b\slave\sanitizer-windows\llvm\tools\clang\lib\Sema\SemaExprCXX.cpp(5704):
error C2326: 
'clang::Sema::FindCompositePointerType::Conversion::Conversion(clang::Sema
&,clang::SourceLocation,clang::Expr *&,clang::Expr
*&,clang::QualType)': function cannot access 'Loc'
C:\b\slave\sanitizer-windows\llvm\tools\clang\lib\Sema\SemaExprCXX.cpp(5704):
error C2512: 'clang::InitializationKind::InitializationKind': no
appropriate default constructor available
251843.519 [4/2/26] Building CXX object
lib\Target\X86\CMakeFiles\LLVMX86CodeGen.dir\X86WinAllocaExpander.cpp.obj
251843.902 [4/1/27] Building CXX object
lib\Target\X86\CMakeFiles\LLVMX86CodeGen.dir\X86TargetMachine.cpp.obj
251846.937 [4/0/28] Building CXX object
lib\Target\X86\CMakeFiles\LLVMX86CodeGen.dir\X86ISelLowering.cpp.obj
ninja: build stopped: subcommand failed.



On Wed, Oct 19, 2016 at 6:29 PM Richard Smith via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: rsmith
> Date: Wed Oct 19 20:20:00 2016
> New Revision: 284685
>
> URL: http://llvm.org/viewvc/llvm-project?rev=284685=rev
> Log:
> Refactor and simplify Sema::FindCompositePointerType. No functionality
> change intended.
>
> Modified:
> cfe/trunk/lib/Sema/SemaExprCXX.cpp
>
> Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=284685=284684=284685=diff
>
> ==
> --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Oct 19 20:20:00 2016
> @@ -5520,7 +5520,7 @@ QualType Sema::CXXCheckConditionalOperan
>  /// \brief Find a merged pointer type and convert the two expressions to
> it.
>  ///
>  /// This finds the composite pointer type (or member pointer type) for @p
> E1
> -/// and @p E2 according to C++11 5.9p2. It converts both expressions to
> this
> +/// and @p E2 according to C++1z 5p14. It converts both expressions to
> this
>  /// type and returns it.
>  /// It does not emit diagnostics.
>  ///
> @@ -5538,69 +5538,87 @@ QualType Sema::FindCompositePointerType(
>  *NonStandardCompositeType = false;
>
>assert(getLangOpts().CPlusPlus && "This function assumes C++");
> +
> +  // C++1z [expr]p14:
> +  //   The composite pointer type of two operands p1 and p2 having types
> T1
> +  //   and T2
>QualType T1 = E1->getType(), T2 = E2->getType();
>
> -  // C++11 5.9p2
> -  //   Pointer conversions and qualification conversions are performed on
> -  //   pointer operands to bring them to their composite pointer type. If
> -  //   one operand is a null pointer constant, the composite pointer type
> is
> -  //   std::nullptr_t if the other operand is also a null pointer
> constant 

r283242 - [sancov] documentation update after r283241

2016-10-04 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Tue Oct  4 14:19:16 2016
New Revision: 283242

URL: http://llvm.org/viewvc/llvm-project?rev=283242=rev
Log:
[sancov] documentation update after r283241

Modified:
cfe/trunk/docs/SanitizerCoverage.rst

Modified: cfe/trunk/docs/SanitizerCoverage.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SanitizerCoverage.rst?rev=283242=283241=283242=diff
==
--- cfe/trunk/docs/SanitizerCoverage.rst (original)
+++ cfe/trunk/docs/SanitizerCoverage.rst Tue Oct  4 14:19:16 2016
@@ -135,7 +135,7 @@ to produce a ``.symcov`` file first:
 sancov -symbolize my_program.123.sancov my_program > my_program.123.symcov
 
 The ``.symcov`` file can be browsed overlayed over the source code by
-running ``tools/sancov/sancov-report-server.py`` script that will start
+running ``tools/sancov/coverage-report-server.py`` script that will start
 an HTTP server.
 
 


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


r282948 - [sancov] -symbolize documentation update

2016-09-30 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Fri Sep 30 16:02:56 2016
New Revision: 282948

URL: http://llvm.org/viewvc/llvm-project?rev=282948=rev
Log:
[sancov] -symbolize documentation update

Modified:
cfe/trunk/docs/SanitizerCoverage.rst

Modified: cfe/trunk/docs/SanitizerCoverage.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SanitizerCoverage.rst?rev=282948=282947=282948=diff
==
--- cfe/trunk/docs/SanitizerCoverage.rst (original)
+++ cfe/trunk/docs/SanitizerCoverage.rst Fri Sep 30 16:02:56 2016
@@ -114,7 +114,7 @@ Sancov matches these files using module
   -print- Print coverage addresses
   -covered-functions- Print all covered functions.
   -not-covered-functions- Print all not covered functions.
-  -html-report  - Print HTML coverage report.
+  -symbolize- Symbolizes the report.
 
 Options
   -blacklist= - Blacklist file (sanitizer blacklist 
format).
@@ -122,13 +122,20 @@ Sancov matches these files using module
   -strip_path_prefix= - Strip this prefix from file paths in 
reports
 
 
-Automatic HTML Report Generation
+Coverage Reports (Experimental)
 
 
-If ``*SAN_OPTIONS`` contains ``html_cov_report=1`` option set, then html
-coverage report would be automatically generated alongside the coverage files.
-The ``sancov`` binary should be present in ``PATH`` or
-``sancov_path= my_program.123.symcov
+
+The ``.symcov`` file can be browsed overlayed over the source code by
+running ``tools/sancov/sancov-report-server.py`` script that will start
+an HTTP server.
 
 
 How good is the coverage?


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


Re: [libcxx] r281179 - [libcxx] Introduce an externally-threaded libc++ variant.

2016-09-12 Thread Mike Aizatsky via cfe-commits
Asiri,

The boot strap build has started to fail for. Your change seems to be
related, right?

[14/22] Building CXX object
projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/locale.cpp.o
FAILED: /usr/bin/g++   -D_DEBUG -D_GNU_SOURCE
-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER -D__STDC_CONSTANT_MACROS
-D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/libcxx/lib
-I/usr/local/google/home/aizatsky/
src/llvm/projects/libcxx/lib -Iinclude
-I/usr/local/google/home/aizatsky/src/llvm/include
-I/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include -fPIC
-fvisibility-inlines-hidden -Wall -W -Wno-unuse
d-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers
 -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor
-Wno-comment -std=c++11 -ffunction-sections -fdata-sections -O3 -UN
DEBUG -DLIBCXX_BUILDING_LIBCXXABI -std=c++11 -nostdinc++ -Wall -Wextra -W
-Wwrite-strings -Wno-unused-parameter -Wno-long-long -Werror=return-type
-Wno-attributes -Wno-literal-suffix -Wno-c++14-compat -Wno-erro
r -fPIC -MMD -MT
projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/locale.cpp.o -MF
projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/src/locale.cpp.o.d -o
projects/libcxx/lib/CMakeFiles/cxx_objects.dir/__/
src/locale.cpp.o -c
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/src/locale.cpp
In file included from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/__mutex_base:17:0,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/mutex:189,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/__locale:18,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/locale:182,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/src/locale.cpp:17:
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/__threading_support:22:90:
error: missing binary operator before token "("
 #if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) && (!defined(__has_include)
|| __has_include(<__external_threading>))

  ^
In file included from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/algorithm:637:0,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/__string:55,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/string_view:166,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/include/string:464,
 from
/usr/local/google/home/aizatsky/src/llvm/projects/libcxx/src/locale.cpp:16:


On Sun, Sep 11, 2016 at 2:55 PM Asiri Rathnayake via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: asiri
> Date: Sun Sep 11 16:46:40 2016
> New Revision: 281179
>
> URL: http://llvm.org/viewvc/llvm-project?rev=281179=rev
> Log:
> [libcxx] Introduce an externally-threaded libc++ variant.
>
> This patch further decouples libc++ from pthread, allowing libc++ to be
> built
> against other threading systems. There are two main use cases:
>
> - Building libc++ against a thread library other than pthreads.
>
> - Building libc++ with an "external" thread API, allowing a separate
> library to
>   provide the implementation of that API.
>
> The two use cases are quite similar, the second one being sligtly more
> de-coupled than the first. The cmake option LIBCXX_HAS_EXTERNAL_THREAD_API
> enables both kinds of builds. One needs to place an <__external_threading>
> header file containing an implementation of the "libc++ thread API"
> declared
> in the <__threading_support> header.
>
> For the second use case, the implementation of the libc++ thread API can
> delegate to a custom "external" thread API where the implementation of this
> external API is provided in a seperate library. This mechanism allows
> toolchain
> vendors to distribute a build of libc++ with a custom thread-porting-layer
> API
> (which is the "external" API above), platform vendors (recipients of the
> toolchain/libc++) are then required to provide their implementation of
> this API
> to be linked with (end-user) C++ programs.
>
> Note that the second use case still requires establishing the basic types
> that
> get passed between the external thread library and the libc++ library
> (e.g. __libcpp_mutex_t). These cannot be opaque pointer types (libc++
> sources
> won't compile otherwise). It should also be noted that the second use case
> can
> have a slight performance penalty; as all the thread constructs need to
> cross a
> library boundary through an additional function call.
>
> When the header <__external_threading> is omitted, libc++ is built with the
> "libc++ thread API" (declared in <__threading_support>) as the "external"
> thread
> API (basic types are pthread based). An implementation (pthread based) of
> this
> API is provided in test/support/external_threads.cpp, which is built into a
> separate DSO and linked in when running the libc++ test suite. A 

Re: r277134 - [GCC] Support for __final specifier

2016-07-29 Thread Mike Aizatsky via cfe-commits
Andrey,

This change breaks the bot:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15093

==15371==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x733784d in
clang::Parser::ParseOptionalCXX11VirtSpecifierSeq(clang::VirtSpecifiers&,
bool, clang::SourceLocation)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:2050:9
#1 0x7337d55 in
clang::Parser::ParseCXXMemberDeclaratorBeforeInitializer(clang::Declarator&,
clang::VirtSpecifiers&, clang::ActionResult&,
clang::Parser::LateParsedAttrList&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:2119:5
#2 0x733d2b9 in
clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier,
clang::AttributeList*, clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:2475:7
#3 0x73441a7 in
clang::Parser::ParseCXXClassMemberDeclarationWithPragmas(clang::AccessSpecifier&,
clang::Parser::ParsedAttributesWithRange&, clang::TypeSpecifierType,
clang::Decl*) 
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:2943:10
#4 0x733264c in
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation,
clang::SourceLocation, clang::Parser::ParsedAttributesWithRange&,
unsigned int, clang::Decl*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:3113:7
#5 0x732b9c4 in
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
bool, clang::Parser::DeclSpecContext,
clang::Parser::ParsedAttributesWithRange&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:1775:7
#6 0x72cb42c in
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDecl.cpp:3413:7
#7 0x7474138 in
clang::Parser::ParseSingleDeclarationAfterTemplate(unsigned int,
clang::Parser::ParsedTemplateInfo const&,
clang::ParsingDeclRAIIObject&, clang::SourceLocation&,
clang::AccessSpecifier, clang::AttributeList*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseTemplate.cpp:207:3
#8 0x7472b4d in
clang::Parser::ParseTemplateDeclarationOrSpecialization(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseTemplate.cpp:152:10
#9 0x747159a in
clang::Parser::ParseDeclarationStartingWithTemplate(unsigned int,
clang::SourceLocation&, clang::AccessSpecifier, clang::AttributeList*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseTemplate.cpp:38:10
#10 0x72c86ed in clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1492:18
#11 0x72819fd in
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/Parser.cpp:749:14
#12 0x7318897 in
clang::Parser::ParseInnerNamespace(std::__1::vector&,
std::__1::vector >&,
std::__1::vector&, unsigned int,
clang::SourceLocation&, clang::ParsedAttributes&,
clang::BalancedDelimiterTracker&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:221:7
#13 0x731722e in clang::Parser::ParseNamespace(unsigned int,
clang::SourceLocation&, clang::SourceLocation)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp:195:3
#14 0x72c8955 in clang::Parser::ParseDeclaration(unsigned int,
clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/ParseDecl.cpp:1505:12
#15 0x72819fd in
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Parse/Parser.cpp:749:14
#16 0x7281027 in
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr&)

Re: r276782 - [analyzer] Add basic capabilities to detect source code clones.

2016-07-26 Thread Mike Aizatsky via cfe-commits
Artem,

I think you broke the build. Could you take a look please?

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/11051
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/11051/steps/build%20clang/logs/stdio

[80/140] Building CXX object
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o
FAILED: 
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o
/usr/bin/c++   -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER
-DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE
-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-Itools/clang/lib/StaticAnalyzer/Checkers
-I/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/tools/clang/lib/StaticAnalyzer/Checkers
-I/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/tools/clang/include
-Itools/clang/include -Iinclude
-I/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/include
-fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor
-Wno-comment -Werror=date-time -std=c++11 -ffunction-sections
-fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing
-O3 -DNDEBUG-fno-exceptions -fno-rtti -MMD -MT
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o
-MF 
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o.d
-o 
tools/clang/lib/StaticAnalyzer/Checkers/CMakeFiles/clangStaticAnalyzerCheckers.dir/CloneChecker.cpp.o
-c 
/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp:29:25:
error: declaration of ‘clang::CloneDetector
{anonymous}::CloneChecker::CloneDetector’ [-fpermissive]
   mutable CloneDetector CloneDetector;
 ^
In file included from
/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CloneChecker.cpp:17:0:
/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/tools/clang/include/clang/Analysis/CloneDetection.h:158:7:
error: changes meaning of ‘CloneDetector’ from ‘class
clang::CloneDetector’ [-fpermissive]
 class CloneDetector {
   ^



On Tue, Jul 26, 2016 at 11:28 AM Artem Dergachev via cfe-commits <
cfe-commits@lists.llvm.org> wrote:

> Author: dergachev
> Date: Tue Jul 26 13:13:12 2016
> New Revision: 276782
>
> URL: http://llvm.org/viewvc/llvm-project?rev=276782=rev
> Log:
> [analyzer] Add basic capabilities to detect source code clones.
>
> This patch adds the CloneDetector class which allows searching source code
> for clones.
>
> For every statement or group of statements within a compound statement,
> CloneDetector computes a hash value, and finds clones by detecting
> identical hash values.
>
> This initial patch only provides a simple hashing mechanism
> that hashes the kind of each sub-statement.
>
> This patch also adds CloneChecker - a simple static analyzer checker
> that uses CloneDetector to report copy-pasted code.
>
> Patch by Raphael Isemann!
>
> Differential Revision: https://reviews.llvm.org/D20795
>
> Added:
> cfe/trunk/include/clang/Analysis/CloneDetection.h
> cfe/trunk/lib/Analysis/CloneDetection.cpp
> cfe/trunk/lib/StaticAnalyzer/Checkers/CloneChecker.cpp
> cfe/trunk/test/Analysis/copypaste/
> cfe/trunk/test/Analysis/copypaste/blocks.cpp
> cfe/trunk/test/Analysis/copypaste/false-positives.cpp
> cfe/trunk/test/Analysis/copypaste/functions.cpp
> cfe/trunk/test/Analysis/copypaste/objc-methods.m
> cfe/trunk/test/Analysis/copypaste/sub-sequences.cpp
> Modified:
> cfe/trunk/include/clang/StaticAnalyzer/Checkers/Checkers.td
> cfe/trunk/lib/Analysis/CMakeLists.txt
> cfe/trunk/lib/StaticAnalyzer/Checkers/CMakeLists.txt
>
> Added: cfe/trunk/include/clang/Analysis/CloneDetection.h
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/CloneDetection.h?rev=276782=auto
>
> ==
> --- cfe/trunk/include/clang/Analysis/CloneDetection.h (added)
> +++ cfe/trunk/include/clang/Analysis/CloneDetection.h Tue Jul 26 13:13:12
> 2016
> @@ -0,0 +1,235 @@
> +//===--- CloneDetection.h - Finds code clones in an AST -*- C++
> -*-===//
> +//
> +// The LLVM Compiler Infrastructure
> +//
> +// This file is distributed under the University of Illinois Open Source
> +// License. See LICENSE.TXT for details.
> +//
>
> +//===--===//
> +///
> +/// /file
> +/// This file defines 

Re: r273290 - Added calculateRangesAfterReplaments() to calculate affacted ranges in the new code.

2016-06-21 Thread Mike Aizatsky via cfe-commits
I think this change has buffer overflow. It breaks asan build:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/13946

FAIL: Clang-Unit ::
Tooling/ToolingTests/Range.RangesWithNonOverlappingReplacements (9361
of 9474)
 TEST 'Clang-Unit ::
Tooling/ToolingTests/Range.RangesWithNonOverlappingReplacements'
FAILED 
Note: Google Test filter = Range.RangesWithNonOverlappingReplacements
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from Range
[ RUN  ] Range.RangesWithNonOverlappingReplacements
=
==32475==ERROR: AddressSanitizer: global-buffer-overflow on address
0x078a4b02 at pc 0x00540095 bp 0x7ffcd9799a10 sp
0x7ffcd97991c0
READ of size 5 at 0x078a4b02 thread T0
#0 0x540094 in __asan_memcpy
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:393
#1 0x7f6e902e6dc1 in copy
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/projects/libcxx/include/string:655:50
#2 0x7f6e902e6dc1 in std::__1::basic_string::__init(char
const*, unsigned long)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/projects/libcxx/include/string:2054
#3 0x30b45e3 in basic_string
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/libcxx_build_asan/include/c++/v1/string:2086:5
#4 0x30b45e3 in
clang::tooling::calculateRangesAfterReplacements(std::__1::set const&,
std::__1::vector const&)
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Tooling/Core/Replacement.cpp:325
#5 0xaa1a6c in
clang::tooling::Range_RangesWithNonOverlappingReplacements_Test::TestBody()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/unittests/Tooling/RefactoringTest.cpp:503:3
#6 0x241400a in HandleExceptionsInMethodIfSupported 
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2145:12
#7 0x241400a in testing::Test::Run()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2161
#8 0x2415426 in testing::TestInfo::Run()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2309:5
#9 0x241636a in testing::TestCase::Run()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2416:5
#10 0x242c6fc in testing::internal::UnitTestImpl::RunAllTests()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4207:11
#11 0x242b808 in
HandleExceptionsInMethodIfSupported 
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2145:12
#12 0x242b808 in testing::UnitTest::Run()
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:3841
#13 0x24000dd in main
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:48:10
#14 0x7f6e8fcdcf44 in __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21f44)
#15 0x4aeb02 in _start
(/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm_build_asan/tools/clang/unittests/Tooling/ToolingTests+0x4aeb02)

0x078a4b02 is located 62 bytes to the left of global variable
'' defined in
'/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/ADT/SmallVector.h:150:5'
(0x78a4b40) of size 13
  '' is ascii string 'idx < size()'
0x078a4b02 is located 0 bytes to the right of global variable
'' defined in
'/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/tools/clang/lib/Tooling/Core/Replacement.cpp:325:49'
(0x78a4b00) of size 2
  '' is ascii string ' '
SUMMARY: AddressSanitizer: global-buffer-overflow
/mnt/b/sanitizer-buildbot3/sanitizer-x86_64-linux-fast/build/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc:393
in __asan_memcpy
Shadow bytes around the buggy address:
  0x80f0c910: 00 00 00 00 00 00 00 00 00 07 f9 f9 f9 f9 f9 f9
  0x80f0c920: 00 00 00 00 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
  0x80f0c930: 03 f9 f9 f9 f9 f9 f9 f9 03 f9 f9 f9 f9 f9 f9 f9
  0x80f0c940: 03 f9 f9 f9 f9 f9 f9 f9 02 f9 f9 f9 f9 f9 f9 f9
  0x80f0c950: 00 f9 f9 f9 f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9
=>0x80f0c960:[02]f9 f9 f9 f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9
  0x80f0c970: 00 00 00 00 00 00 00 00 00 00 00 00 01 f9 f9 f9
  0x80f0c980: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x80f0c990: 00 00 00 00 00 04 f9 f9 f9 f9 f9 f9 00 00 00 00

r260630 - [sancov] improved object files handling.

2016-02-11 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Thu Feb 11 18:29:45 2016
New Revision: 260630

URL: http://llvm.org/viewvc/llvm-project?rev=260630=rev
Log:
[sancov] improved object files handling.

Documentation change for: http://reviews.llvm.org/D17169

Differential Revision: http://reviews.llvm.org/D17175

Modified:
cfe/trunk/docs/SanitizerCoverage.rst

Modified: cfe/trunk/docs/SanitizerCoverage.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SanitizerCoverage.rst?rev=260630=260629=260630=diff
==
--- cfe/trunk/docs/SanitizerCoverage.rst (original)
+++ cfe/trunk/docs/SanitizerCoverage.rst Thu Feb 11 18:29:45 2016
@@ -99,12 +99,14 @@ Sancov Tool
 
 A new experimental ``sancov`` tool is developed to process coverage files.
 The tool is part of LLVM project and is currently supported only on Linux.
-It can handle symbolization tasks autonomously without needed any extra 
-support from environment.
+It can handle symbolization tasks autonomously without any extra support
+from the environment. You need to pass .sancov files (named 
+``..sancov`` and paths to all corresponding binary elf 
files. 
+Sancov matches these files using module names and binaries file names.
 
 .. code-block:: console
 
-USAGE: sancov [options]  
+USAGE: sancov [options]  (|<.sancov file>)...
 
 Action (required)
   -print- Print coverage addresses
@@ -115,7 +117,6 @@ support from environment.
 Options
   -blacklist= - Blacklist file (sanitizer blacklist 
format).
   -demangle   - Print demangled function name.
-  -obj=   - Path to object file to be symbolized
   -strip_path_prefix= - Strip this prefix from file paths in 
reports
 
 


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


r259000 - [sancov] sancov tool documentation

2016-01-27 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Wed Jan 27 17:56:12 2016
New Revision: 259000

URL: http://llvm.org/viewvc/llvm-project?rev=259000=rev
Log:
[sancov] sancov tool documentation

Differential Revision: http://reviews.llvm.org/D16432

Modified:
cfe/trunk/docs/SanitizerCoverage.rst

Modified: cfe/trunk/docs/SanitizerCoverage.rst
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/docs/SanitizerCoverage.rst?rev=259000=258999=259000=diff
==
--- cfe/trunk/docs/SanitizerCoverage.rst (original)
+++ cfe/trunk/docs/SanitizerCoverage.rst Wed Jan 27 17:56:12 2016
@@ -94,6 +94,40 @@ numbers:
 cov.cc:3
 cov.cc:5
 
+Sancov Tool
+===
+
+A new experimental ``sancov`` tool is developed to process coverage files.
+The tool is part of LLVM project and is currently supported only on Linux.
+It can handle symbolization tasks autonomously without needed any extra 
+support from environment.
+
+.. code-block:: console
+
+USAGE: sancov [options]  
+
+Action (required)
+  -print- Print coverage addresses
+  -covered-functions- Print all covered funcions.
+  -not-covered-functions- Print all not covered funcions.
+  -html-report  - Print HTML coverage report.
+
+Options
+  -blacklist= - Blacklist file (sanitizer blacklist 
format).
+  -demangle   - Print demangled function name.
+  -obj=   - Path to object file to be symbolized
+  -strip_path_prefix= - Strip this prefix from file paths in 
reports
+
+
+Automatic HTML Report Generation
+
+
+If ``*SAN_OPTIONS`` contains ``html_cov_report=1`` option set, then html
+coverage report would be automatically generated alongside the coverage files.
+The ``sancov`` binary should be present in ``PATH`` or
+``sancov_path=

Re: [PATCH] D15203: clang-tidy readability identifiers: better diagnostic location

2015-12-04 Thread Mike Aizatsky via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL254766: clang-tidy readability identifiers: better 
diagnostic location (authored by aizatsky).

Changed prior to commit:
  http://reviews.llvm.org/D15203?vs=41794=41931#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D15203

Files:
  clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
  clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp

Index: clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
===
--- clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
+++ clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
@@ -661,7 +661,7 @@
   continue;
 
 if (Failure.ShouldFix) {
-  auto Diag = diag(Decl.getLocStart(), "invalid case style for %0 '%1'")
+  auto Diag = diag(Decl.getLocation(), "invalid case style for %0 '%1'")
   << Failure.KindName << Decl.getName();
 
   for (const auto  : Failure.RawUsageLocs) {
Index: clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp
===
--- clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp
+++ clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp
@@ -74,10 +74,10 @@
 // the -header-filter= option
 
 namespace FOO_NS {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for namespace 'FOO_NS' [readability-identifier-naming]
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for namespace 'FOO_NS' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}namespace foo_ns {{{$}}
 inline namespace InlineNamespace {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for inline namespace 'InlineNamespace'
+// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for inline namespace 'InlineNamespace'
 // CHECK-FIXES: {{^}}inline namespace inline_namespace {{{$}}
 
 SYSTEM_NS::structure g_s1;
@@ -102,7 +102,7 @@
 // NO warnings or fixes expected as FOO_bar is from macro expansion
 
 enum my_enumeration {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for enum 'my_enumeration'
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for enum 'my_enumeration'
 // CHECK-FIXES: {{^}}enum EMyEnumeration {{{$}}
 MyConstant = 1,
 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for enum constant 'MyConstant'
@@ -116,11 +116,11 @@
 };
 
 constexpr int ConstExpr_variable = MyConstant;
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for constexpr variable 'ConstExpr_variable'
+// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for constexpr variable 'ConstExpr_variable'
 // CHECK-FIXES: {{^}}constexpr int const_expr_variable = MY_CONSTANT;{{$}}
 
 class my_class {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for class 'my_class'
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 'my_class'
 // CHECK-FIXES: {{^}}class CMyClass {{{$}}
 my_class();
 // CHECK-FIXES: {{^}}CMyClass();{{$}}
@@ -132,107 +132,107 @@
 // CHECK-FIXES: {{^}}  CMyClass();{{$}}
 
   const int MEMBER_one_1 = ConstExpr_variable;
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: invalid case style for constant member 'MEMBER_one_1'
+// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for constant member 'MEMBER_one_1'
 // CHECK-FIXES: {{^}}  const int member_one_1 = const_expr_variable;{{$}}
   int member2 = 2;
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: invalid case style for private member 'member2'
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for private member 'member2'
 // CHECK-FIXES: {{^}}  int __member2 = 2;{{$}}
 
 private:
 int private_member = 3;
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for private member 'private_member'
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for private member 'private_member'
 // CHECK-FIXES: {{^}}int __private_member = 3;{{$}}
 
 protected:
 int ProtMember;
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for protected member 'ProtMember'
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for protected member 'ProtMember'
 // CHECK-FIXES: {{^}}int _ProtMember;{{$}}
 
 public:
 int PubMem;
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for public member 'PubMem'
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for public member 'PubMem'
 // CHECK-FIXES: {{^}}int pub_mem;{{$}}
 
 static const int classConstant;
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for class constant 'classConstant'
+// CHECK-MESSAGES: :[[@LINE-1]]:22: warning: invalid case style for class constant 'classConstant'
 // CHECK-FIXES: {{^}}static const int 

[clang-tools-extra] r254766 - clang-tidy readability identifiers: better diagnostic location

2015-12-04 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Fri Dec  4 14:57:03 2015
New Revision: 254766

URL: http://llvm.org/viewvc/llvm-project?rev=254766=rev
Log:
clang-tidy readability identifiers: better diagnostic location

Summary:
With this change the error reported is on the identifier location
itself. It was declaration location before.

Reviewers: alexfh

Differential Revision: http://reviews.llvm.org/D15203

Modified:
clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp

Modified: 
clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp?rev=254766=254765=254766=diff
==
--- clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp 
(original)
+++ clang-tools-extra/trunk/clang-tidy/readability/IdentifierNamingCheck.cpp 
Fri Dec  4 14:57:03 2015
@@ -661,7 +661,7 @@ void IdentifierNamingCheck::onEndOfTrans
   continue;
 
 if (Failure.ShouldFix) {
-  auto Diag = diag(Decl.getLocStart(), "invalid case style for %0 '%1'")
+  auto Diag = diag(Decl.getLocation(), "invalid case style for %0 '%1'")
   << Failure.KindName << Decl.getName();
 
   for (const auto  : Failure.RawUsageLocs) {

Modified: 
clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp
URL: 
http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp?rev=254766=254765=254766=diff
==
--- clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp 
(original)
+++ clang-tools-extra/trunk/test/clang-tidy/readability-identifier-naming.cpp 
Fri Dec  4 14:57:03 2015
@@ -74,10 +74,10 @@
 // the -header-filter= option
 
 namespace FOO_NS {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for namespace 
'FOO_NS' [readability-identifier-naming]
+// CHECK-MESSAGES: :[[@LINE-1]]:11: warning: invalid case style for namespace 
'FOO_NS' [readability-identifier-naming]
 // CHECK-FIXES: {{^}}namespace foo_ns {{{$}}
 inline namespace InlineNamespace {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for inline 
namespace 'InlineNamespace'
+// CHECK-MESSAGES: :[[@LINE-1]]:18: warning: invalid case style for inline 
namespace 'InlineNamespace'
 // CHECK-FIXES: {{^}}inline namespace inline_namespace {{{$}}
 
 SYSTEM_NS::structure g_s1;
@@ -102,7 +102,7 @@ BLA;
 // NO warnings or fixes expected as FOO_bar is from macro expansion
 
 enum my_enumeration {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for enum 
'my_enumeration'
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: invalid case style for enum 
'my_enumeration'
 // CHECK-FIXES: {{^}}enum EMyEnumeration {{{$}}
 MyConstant = 1,
 // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for enum 
constant 'MyConstant'
@@ -116,11 +116,11 @@ enum my_enumeration {
 };
 
 constexpr int ConstExpr_variable = MyConstant;
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for constexpr 
variable 'ConstExpr_variable'
+// CHECK-MESSAGES: :[[@LINE-1]]:15: warning: invalid case style for constexpr 
variable 'ConstExpr_variable'
 // CHECK-FIXES: {{^}}constexpr int const_expr_variable = MY_CONSTANT;{{$}}
 
 class my_class {
-// CHECK-MESSAGES: :[[@LINE-1]]:1: warning: invalid case style for class 
'my_class'
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for class 
'my_class'
 // CHECK-FIXES: {{^}}class CMyClass {{{$}}
 my_class();
 // CHECK-FIXES: {{^}}CMyClass();{{$}}
@@ -132,62 +132,62 @@ class my_class {
 // CHECK-FIXES: {{^}}  CMyClass();{{$}}
 
   const int MEMBER_one_1 = ConstExpr_variable;
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: invalid case style for constant 
member 'MEMBER_one_1'
+// CHECK-MESSAGES: :[[@LINE-1]]:13: warning: invalid case style for constant 
member 'MEMBER_one_1'
 // CHECK-FIXES: {{^}}  const int member_one_1 = const_expr_variable;{{$}}
   int member2 = 2;
-// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: invalid case style for private 
member 'member2'
+// CHECK-MESSAGES: :[[@LINE-1]]:7: warning: invalid case style for private 
member 'member2'
 // CHECK-FIXES: {{^}}  int __member2 = 2;{{$}}
 
 private:
 int private_member = 3;
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for private 
member 'private_member'
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for private 
member 'private_member'
 // CHECK-FIXES: {{^}}int __private_member = 3;{{$}}
 
 protected:
 int ProtMember;
-// CHECK-MESSAGES: :[[@LINE-1]]:5: warning: invalid case style for protected 
member 'ProtMember'
+// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for protected 
member 'ProtMember'
 // 

Re: [PATCH] D15170: clang-tidy llvm name checker: variables should start with upper case

2015-12-03 Thread Mike Aizatsky via cfe-commits
aizatsky added a comment.

I didn't really intend for review this yet - this was only experiment and I
also discovered a generic naming tidy check.

But putting this aside, is there an interest to have more style conformance
checks?


Repository:
  rL LLVM

http://reviews.llvm.org/D15170



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


r252501 - Moving FileManager::removeDotPaths to llvm::sys::path::remove_dots

2015-11-09 Thread Mike Aizatsky via cfe-commits
Author: aizatsky
Date: Mon Nov  9 13:12:18 2015
New Revision: 252501

URL: http://llvm.org/viewvc/llvm-project?rev=252501=rev
Log:
Moving FileManager::removeDotPaths to llvm::sys::path::remove_dots

Differential Revision: http://reviews.llvm.org/D14394

Modified:
cfe/trunk/include/clang/Basic/FileManager.h
cfe/trunk/lib/Basic/FileManager.cpp
cfe/trunk/lib/Basic/VirtualFileSystem.cpp
cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp

Modified: cfe/trunk/include/clang/Basic/FileManager.h
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/FileManager.h?rev=252501=252500=252501=diff
==
--- cfe/trunk/include/clang/Basic/FileManager.h (original)
+++ cfe/trunk/include/clang/Basic/FileManager.h Mon Nov  9 13:12:18 2015
@@ -273,9 +273,6 @@ public:
   static void modifyFileEntry(FileEntry *File, off_t Size,
   time_t ModificationTime);
 
-  /// \brief Remove any './' components from a path.
-  static bool removeDotPaths(SmallVectorImpl , bool RemoveDotDot = 
false);
-
   /// \brief Retrieve the canonical name for a given directory.
   ///
   /// This is a very expensive operation, despite its results being cached,

Modified: cfe/trunk/lib/Basic/FileManager.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/FileManager.cpp?rev=252501=252500=252501=diff
==
--- cfe/trunk/lib/Basic/FileManager.cpp (original)
+++ cfe/trunk/lib/Basic/FileManager.cpp Mon Nov  9 13:12:18 2015
@@ -526,39 +526,6 @@ void FileManager::modifyFileEntry(FileEn
   File->ModTime = ModificationTime;
 }
 
-/// Remove '.' and '..' path components from the given absolute path.
-/// \return \c true if any changes were made.
-// FIXME: Move this to llvm::sys::path.
-bool FileManager::removeDotPaths(SmallVectorImpl , bool 
RemoveDotDot) {
-  using namespace llvm::sys;
-
-  SmallVector ComponentStack;
-  StringRef P(Path.data(), Path.size());
-
-  // Skip the root path, then look for traversal in the components.
-  StringRef Rel = path::relative_path(P);
-  for (StringRef C : llvm::make_range(path::begin(Rel), path::end(Rel))) {
-if (C == ".")
-  continue;
-if (RemoveDotDot) {
-  if (C == "..") {
-if (!ComponentStack.empty())
-  ComponentStack.pop_back();
-continue;
-  }
-}
-ComponentStack.push_back(C);
-  }
-
-  SmallString<256> Buffer = path::root_path(P);
-  for (StringRef C : ComponentStack)
-path::append(Buffer, C);
-
-  bool Changed = (Path != Buffer);
-  Path.swap(Buffer);
-  return Changed;
-}
-
 StringRef FileManager::getCanonicalName(const DirectoryEntry *Dir) {
   // FIXME: use llvm::sys::fs::canonical() when it gets implemented
   llvm::DenseMap::iterator Known
@@ -582,7 +549,7 @@ StringRef FileManager::getCanonicalName(
   // '..' is pretty safe.
   // Ideally we'd have an equivalent of `realpath` and could implement
   // sys::fs::canonical across all the platforms.
-  removeDotPaths(CanonicalNameBuf, /*RemoveDotDot*/true);
+  llvm::sys::path::remove_dots(CanonicalNameBuf, /* remove_dot_dot */ true);
   CanonicalName = StringRef(CanonicalNameBuf).copy(CanonicalNameStorage);
 #endif
 

Modified: cfe/trunk/lib/Basic/VirtualFileSystem.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/VirtualFileSystem.cpp?rev=252501=252500=252501=diff
==
--- cfe/trunk/lib/Basic/VirtualFileSystem.cpp (original)
+++ cfe/trunk/lib/Basic/VirtualFileSystem.cpp Mon Nov  9 13:12:18 2015
@@ -499,7 +499,7 @@ bool InMemoryFileSystem::addFile(const T
   (void)EC;
 
   if (useNormalizedPaths())
-FileManager::removeDotPaths(Path, /*RemoveDotDot=*/true);
+llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
 
   if (Path.empty())
 return false;
@@ -572,7 +572,7 @@ lookupInMemoryNode(const InMemoryFileSys
   (void)EC;
 
   if (FS.useNormalizedPaths())
-FileManager::removeDotPaths(Path, /*RemoveDotDot=*/true);
+llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
 
   if (Path.empty())
 return Dir;

Modified: cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp?rev=252501=252500=252501=diff
==
--- cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp (original)
+++ cfe/trunk/lib/Frontend/ModuleDependencyCollector.cpp Mon Nov  9 13:12:18 
2015
@@ -67,7 +67,7 @@ std::error_code ModuleDependencyListener
   path::native(AbsoluteSrc);
   // TODO: We probably need to handle .. as well as . in order to have valid
   // input to the YAMLVFSWriter.
-  FileManager::removeDotPaths(AbsoluteSrc);
+  path::remove_dots(AbsoluteSrc);
 
   // Build the