1. Jan 03, 2017
    • Dean Michael Berris's avatar
      [XRay] Merge instrumentation point table emission code into AsmPrinter. · f7e7b938
      Dean Michael Berris authored
      Summary:
      No need to have this per-architecture.  While there, unify 32-bit ARM's
      behaviour with what changed elsewhere and start function names lowercase
      as per the coding standards.  Individual entry emission code goes to the
      entry's own class.
      
      Fully tested on amd64, cross-builds on both ARMs and PowerPC.
      
      Reviewers: dberris
      
      Subscribers: aemerson, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D28209
      
      llvm-svn: 290858
      f7e7b938
    • Saleem Abdulrasool's avatar
      clang-format: tweak configuration · 720fb14c
      Saleem Abdulrasool authored
      Update the configuration to reflect the style more accurately.  Pointers
      are tied to the left.  Braces are split on classes/structs and
      functions.
      
      llvm-svn: 290857
      720fb14c
    • Saleem Abdulrasool's avatar
      build: remove now unused UNIX_CAT · 83309446
      Saleem Abdulrasool authored
      THe previous change replaced the use of `cat` or `type` with a custom
      python script.  Remove the now unused command determining.
      
      llvm-svn: 290856
      83309446
    • Dean Michael Berris's avatar
      Revert "[XRay][compiler-rt] XRay Flight Data Recorder Mode" · 0aba3571
      Dean Michael Berris authored
      This reverts rL290852 as it breaks aarch64 and arm.
      
      llvm-svn: 290854
      0aba3571
    • Eric Fiselier's avatar
      Fix creating __generated_config on Windows · 887894aa
      Eric Fiselier authored
      llvm-svn: 290853
      887894aa
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] XRay Flight Data Recorder Mode · 33d305b5
      Dean Michael Berris authored
      Summary:
      In this change we introduce the notion of a "flight data recorder" mode
      for XRay logging, where XRay logs in-memory first, and write out data
      on-demand as required (as opposed to the naive implementation that keeps
      logging while tracing is "on"). This depends on D26232 where we
      implement the core data structure for holding the buffers that threads
      will be using to write out records of operation.
      
      This implementation only currently works on x86_64 and depends heavily
      on the TSC math to write out smaller records to the inmemory buffers.
      
      Also, this implementation defines two different kinds of records with
      different sizes (compared to the current naive implementation): a
      MetadataRecord (16 bytes) and a FunctionRecord (8 bytes). MetadataRecord
      entries are meant to write out information like the thread ID for which
      the metadata record is defined for, whether the execution of a thread
      moved to a different CPU, etc. while a FunctionRecord represents the
      different kinds of function call entry/exit records we might encounter
      in the course of a thread's execution along with a delta from the last
      time the logging handler was called.
      
      While this implementation is not exactly what is described in the
      original XRay whitepaper, this one gives us an initial implementation
      that we can iterate and build upon.
      
      Reviewers: echristo, rSerge, majnemer
      
      Subscribers: mehdi_amini, llvm-commits, mgorny
      
      Differential Revision: https://reviews.llvm.org/D27038
      
      llvm-svn: 290852
      33d305b5
    • Saleem Abdulrasool's avatar
      system_error: provide a thread safe stringification for Windows · edd09b3d
      Saleem Abdulrasool authored
      Provide a strerror_r replacement for Windows.  This is needed to build
      libc++ for Windows with threading.
      
      llvm-svn: 290851
      edd09b3d
    • Saleem Abdulrasool's avatar
      threading_support: refactor for Win32 threading · 790e10f6
      Saleem Abdulrasool authored
      Refactor the header to allow us to implement alternate threading models
      with alternate data structures.  Take the opportunity to clang-format
      the area.  This will allow us to avoid re-declaring the interfaces for
      Win32 threading.  NFC
      
      llvm-svn: 290850
      790e10f6
    • Eric Fiselier's avatar
      Recommit r290839 - Fix configuring and building libc++ w/o an ABI library. · 1285e4d6
      Eric Fiselier authored
      This patch re-commits a previous attempt to support building libc++ w/o
      an ABI library. That patch was originally reverted because:
      
      1) It forgot to teach the test suite about "default" ABI libraries.
      
      2) Some LLVM builders don't clear the CMake cache between builds. The previous
         patch caused those builders to fail since their old cache entry for
         LIBCXX_CXX_ABI="" is no longer valid.
      
      The updated patch addresses both issues. It works around (2) by adding
      a hack to force the builders to update their cache entries. The hack will
      be removed shortly once all LLVM builders have run.
      
      Original commit message
      -----------------------
      
      Typically libc++ uses libc++abi or libcxxrt to provide the ABI and runtime bits
      of the C++ STL. However we also support building w/o an ABI library entirely.
      This patch fixes building libc++ w/o an ABI library (and incorporates the
      `~type_info()` fix in D28211).
      
      The main changes in this patch are:
      
      1) Add `-DLIBCXX_CXX_ABI=default` instead of using the empty string to mean "default".
      2) Fix CMake bits which treated "none" as "default" on OS X.
      3) Teach the source files to respect `-D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY`.
      4) Define ~type_info() when _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY is defined.
      
      Unfortunately this patch doesn't help clean up the macro mess that we use to
      configure for different ABI libraries.
      
      llvm-svn: 290849
      1285e4d6
    • Sanjay Patel's avatar
      [EarlyCSE] less else, more auto; NFC · 1c9867d0
      Sanjay Patel authored
      llvm-svn: 290848
      1c9867d0
    • Eric Fiselier's avatar
      0afab989
    • Eric Fiselier's avatar
      Re-implement LWG 2770 - Fix tuple_size with structured bindings. · 1013fe3c
      Eric Fiselier authored
      This patch implements the correct PR for LWG 2770. It also makes the primary
      tuple_size template incomplete again which fixes part of llvm.org/PR31513.
      
      llvm-svn: 290846
      1013fe3c
    • Eric Fiselier's avatar
      Fix use of throw(...) spec with GCC in C++17 · 9877c1e7
      Eric Fiselier authored
      llvm-svn: 290845
      9877c1e7
    • Sanjay Patel's avatar
      [InstCombine] use combineMetadataForCSE instead of copying it; NFCI · b38ad88e
      Sanjay Patel authored
      llvm-svn: 290844
      b38ad88e
    • Richard Smith's avatar
      Add testcase for the regression introduced in r290808. · dadcc182
      Richard Smith authored
      llvm-svn: 290843
      dadcc182
    • Daniel Jasper's avatar
      Remove isIgnored()-test that is more expensive than the analysis behind it · 5cad6856
      Daniel Jasper authored
      In many translation units I have tried, the calls to isIgnored() removed
      in this patch are more expensive than doing the analysis that is behind
      it. The speed-up in translation units I have tried is between 10 and
      20%.
      
      Review: https://reviews.llvm.org/D28208
      llvm-svn: 290842
      5cad6856
    • Eric Fiselier's avatar
      221596df
    • Eric Fiselier's avatar
      Introduce _LIBCPP_DEPRECATED_ABI_EXTERNAL_ERROR_CATEGORY_CONSTRUCTOR ABI option. · 9aca97d6
      Eric Fiselier authored
      Currently libc++ compiles a special version of error_category()
      into the dylib. This definition is no longer needed, and doesn't
      work on Windows due to dllimport/dllexport semantics.
      
      For those reasons this patch introduces an option to
      disable/enable this definition. By default the definition
      is provided in ABI v1 except on windows. This patch
      also addresses D28210.
      
      llvm-svn: 290840
      9aca97d6
    • Eric Fiselier's avatar
      Fix configuring and building libc++ w/o an ABI library. · 5d25843f
      Eric Fiselier authored
      Typically libc++ uses libc++abi or libcxxrt to provide the ABI and runtime bits
      of the C++ STL. However we also support building w/o an ABI library entirely.
      This patch fixes building libc++ w/o an ABI library (and incorporates the
      `~type_info()` fix in D28211).
      
      The main changes in this patch are:
      
      1) Add `-DLIBCXX_CXX_ABI=default` instead of using the empty string to mean "default".
      2) Fix CMake bits which treated "none" as "default" on OS X.
      3) Teach the source files to respect `-D_LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY`.
      4) Define ~type_info() when _LIBCPP_BUILDING_HAS_NO_ABI_LIBRARY is defined.
      
      Unfortunately this patch doesn't help clean up the macro mess that we use to
      configure for different ABI libraries.
      
      llvm-svn: 290839
      5d25843f
    • James Dennett's avatar
      Extend documentation of how to test clang-tidy checks. · e772e066
      James Dennett authored
      Summary:
      The documentation assumed expertise with FileCheck; many clang-tidy check
      authors may not have significant exposure to FileCheck, and so it's worth
      spending a few more words here to spell things out.
      
      Reviewers: alexfh
      
      Subscribers: cfe-commits, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D28189
      
      llvm-svn: 290838
      e772e066
    • Saleem Abdulrasool's avatar
      build: tweak macros for Windows build · 58729cd5
      Saleem Abdulrasool authored
      Move the windows specific macro definitions for compiling c++ into the
      target.  Add a number of newer options that are necessary to properly
      build libc++ for windows.  This ensures that we do not accidentally
      autolink msvcprt (Microsoft's C++ runtime library), do not define linker
      pragmas which are msvcprt specific, and do not accidentally encode the
      incorrect version of the msvc compatibility version.
      
      llvm-svn: 290837
      58729cd5
    • Saleem Abdulrasool's avatar
      build: make cross-compiling to Windows work on Linux · 2d2ed1cc
      Saleem Abdulrasool authored
      Disable the manifest bundling on Windows when cross-compiling on
      not-Windows.  With this, it is possible to execute the link command from
      CMake which will use cmake to invoke the manifest tool to generate a
      manifest and pass that to the linker.
      
      llvm-svn: 290836
      2d2ed1cc
    • Saleem Abdulrasool's avatar
      win32: temporarily disable setting locale on 14+ · 11c0c533
      Saleem Abdulrasool authored
      The locale structures have been made opaque in CRT 14+.  This currently
      prevents building libc++ for Windows.  We can re-enable this in the
      future when we have replicated the structure to access the private field
      for the name (unless there exists a better supported mechanism to query
      the name of a locale given the locale_t).
      
      llvm-svn: 290835
      11c0c533
    • Chris Bieneman's avatar
      [CMake] Set HAVE_${runtime} before including any subdirectories · e205d766
      Chris Bieneman authored
      This should allow us to avoid most order dependence in the runtime library configurations.
      
      llvm-svn: 290834
      e205d766
    • Xin Tong's avatar
      Make sure total loop body weight is preserved in loop peeling · 2940231f
      Xin Tong authored
      Summary:
      Regardless how the loop body weight is distributed, we should preserve
      total loop body weight. i.e. we should have same weight reaching the body of the loop
      or its duplicates in peeled and unpeeled case.
      
      Reviewers: mkuper, davidxl, anemet
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D28179
      
      llvm-svn: 290833
      2940231f
    • Michal Gorny's avatar
      [cmake] Normalize LLVM_ENABLE_DIA_SDK to fix Windows tests · f4233901
      Michal Gorny authored
      Attempts to fix Windows build breakage caused by r290818.
      
      llvm-svn: 290832
      f4233901
    • Eric Fiselier's avatar
      Rework fix for PR19460 - Use explicit bool as an extension instead. · e9735f17
      Eric Fiselier authored
      In the previous fix I used a PMF type as a semi-safe bool type in C++03.
      However immediately after committing I realized clang offered explicit
      conversion operators as an extension. This patch removes the old fix and
      enables _LIBCPP_EXPLICIT using __has_extension instead.
      
      This change also affects the following other classes, which have
      '_LIBCPP_EXPLICIT operator bool()'.
      
      * shared_ptr
      * unique_ptr
      * error_condition
      * basic_ios
      * function (already C++11 only)
      * istream::sentry
      * experimental::string_view.
      
      In all of the above cases I believe it is safe to enable the extension, except
      in the experimental::string_view case. There seem to be some Clang bugs
      affecting the experimental::string_view conversion to std::basic_string. To
      work around that I manually disabled _LIBCPP_EXPLICIT in that case.
      
      llvm-svn: 290831
      e9735f17
    • Daniel Berlin's avatar
      NewGVN: Add a test case for equivalent phis. · aa0ec1e9
      Daniel Berlin authored
      llvm-svn: 290830
      aa0ec1e9
    • Daniel Berlin's avatar
      NewGVN: Add forgotten testcase for PR 31483 · 43a5f998
      Daniel Berlin authored
      llvm-svn: 290829
      43a5f998
    • Daniel Berlin's avatar
      NewGVN: Clean up after removing possibility of null expressions. · de43ef96
      Daniel Berlin authored
      llvm-svn: 290828
      de43ef96
    • Sanjay Patel's avatar
      fix typo; NFC · 65d533ca
      Sanjay Patel authored
      llvm-svn: 290827
      65d533ca
    • Sanjay Patel's avatar
      [ValueTracking] remove stale comments; NFC · 4382997a
      Sanjay Patel authored
      The checks were improved with:
      https://reviews.llvm.org/rL290194
      
      llvm-svn: 290826
      4382997a
    • Davide Italiano's avatar
      [NewGVN] Fold single-use variable inside the assertion. · 67ada75d
      Davide Italiano authored
      It placates some bots which complain because they compile the
      assertion out and think the variable is unused.
      
      llvm-svn: 290825
      67ada75d
    • Saleem Abdulrasool's avatar
      chrono: correct the units for the epoch bias · d1c346a4
      Saleem Abdulrasool authored
      As pointed out by Howard, this is actually 134774 days (* 24 * 3600),
      and therefore seconds, not 100ns units.  Adjust the units to reflect
      reality.
      
      llvm-svn: 290824
      d1c346a4
    • Saleem Abdulrasool's avatar
      locale: update ctype access for MSVC CRT 14+ · 8bcade54
      Saleem Abdulrasool authored
      Visual C++ 14 and newer split msvcrt into msvcrt and ucrt with flavours
      of the ucrt for different environments.  This changed the access to the
      ctype table by introducing the `__pctype_func` and `__pwctype_func`
      accessors.  Use this rather than directly accessing `_ctype` which
      allows us to be safer in threaded situations by going through the libc
      locking.
      
      llvm-svn: 290823
      8bcade54
    • Davide Italiano's avatar
      [NewGVN] Restore old code to placate buildbots. · 84126162
      Davide Italiano authored
      Apparently my suggestion of using ternary doesn't really work
      as clang complains about incompatible types on LHS and RHS. Some
      GCC versions happen to accept the code but clang behaviour is
      correct here.
      
      llvm-svn: 290822
      84126162
    • Omair Javaid's avatar
      XFail TestNoreturnUnwind for arm targets · 999266ab
      Omair Javaid authored
      TestNoreturnUnwind fails on arm/aarch32 linux targets.
      
      Bug is already described for x86_64 android targets in llvm.org/pr31192.
      
      llvm-svn: 290821
      999266ab
    • Daniel Berlin's avatar
      NewGVN: Fix some formatting and comment issues · 25f05b0a
      Daniel Berlin authored
      llvm-svn: 290820
      25f05b0a
    • Michal Gorny's avatar
      [unittests] Split DWARF tests out of PDB, fix standalone build · 95e26292
      Michal Gorny authored
      Split the PDB tests into DWARF test and actual PDB tests, the latter
      requiring DIA SDK. Use the new LLVMConfig.cmake LLVM_ENABLE_DIA_SDK
      symbol to enable the PDB tests rather than relying on
      llvm/Config/config.h private include file that is not available when
      building standalone.
      
      Differential Revision: https://reviews.llvm.org/D26249
      
      llvm-svn: 290819
      95e26292
    • Michal Gorny's avatar
      [cmake] Add LLVM_ENABLE_DIA_SDK option, and expose it in LLVMConfig · 89b6f16b
      Michal Gorny authored
      Add an explicit LLVM_ENABLE_DIA_SDK option to control building support
      for DIA SDK-based debugging. Control its value to match whether DIA SDK
      support was found and expose it in LLVMConfig (alike LLVM_ENABLE_ZLIB).
      
      Its value is needed for LLDB to determine whether to run tests requiring
      DIA support. Currently it is obtained from llvm/Config/config.h;
      however, this file is not available for standalone builds. Following
      this change, LLDB will be modified to use the value from LLVMConfig.
      
      Differential Revision: https://reviews.llvm.org/D26255
      
      llvm-svn: 290818
      89b6f16b