1. Jul 23, 2018
  2. Jul 22, 2018
  3. Jul 21, 2018
    • Zachary Turner's avatar
      [llvm-undname] Flush output before demangling. · c93b870c
      Zachary Turner authored
      If an error occurs and we write it to stderr, it could appear
      before we wrote the mangled name which we're undecorating.
      By flushing stdout first, we ensure that the messages are always
      sequenced in the correct order.
      
      llvm-svn: 337645
      c93b870c
    • Zachary Turner's avatar
      Fix the MSVC Visualizers for SmallVector classes. · 3d5a6dd6
      Zachary Turner authored
      Recent changes to the internal structure of SmallVector<> broke
      all of the MSVC visualizers.  This fixes them.
      
      llvm-svn: 337644
      3d5a6dd6
    • Aditya Kumar's avatar
      Early exit with cheaper checks · 373ce7ec
      Aditya Kumar authored
      Reviewers: sebpop,davide,fhahn,trentxintong
      Differential Revision: https://reviews.llvm.org/D49617
      
      llvm-svn: 337643
      373ce7ec
    • Chen Zheng's avatar
      [InstrSimplify] fold sdiv if two operands are negated and non-overflow · 69bb0645
      Chen Zheng authored
      Differential Revision: https://reviews.llvm.org/D49382
      
      llvm-svn: 337642
      69bb0645
    • Aaron Smith's avatar
      [DebugInfo] Add a new DI flag to record if a C++ record is a trivial type · 23c2d1c1
      Aaron Smith authored
      Summary:
      This flag is used when emitting debug info and is needed to initialize subprogram and member function attributes (function options) for Codeview. These function options are used to create an accurate compiler type for UDT symbols (class/struct/union) from PDBs.
      
      It is not easy to determine if a C++ record is trivial or not based on the current DICompositeType flags and other accessible debug information from Codeview. For example, without this flag the metadata for a non-trivial C++ record with user-defined ctor and a trivial one with a defaulted ctor are the same.
      
          struct S { S(); }
          struct S { S() = default; }
      
      This change introduces a new DI flag and corresponding clang::CXXRecordDecl::isTrivial method to set the flag in the frontend.
      
      Reviewers: rnk, zturner, llvm-commits, dblaikie, aleksandr.urakov, deadalnix
      
      Reviewed By: rnk
      
      Subscribers: asmith, probinson, aprantl, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D45122
      
      llvm-svn: 337641
      23c2d1c1
    • Peter Collingbourne's avatar
      ELF: Read address significance tables with --icf=all. · a052206c
      Peter Collingbourne authored
      Under --icf=all we now only apply KeepUnique to non-executable
      address-significant sections. This has the effect of making --icf=all
      mean unsafe ICF for executable sections and safe ICF for non-executable
      sections.
      
      With this change the meaning of the KeepUnique bit changes to
      "does the current ICF mode (together with the --keep-unique and
      --ignore-data-address-equality flags) require this section to be
      kept unique".
      
      Differential Revision: https://reviews.llvm.org/D49626
      
      llvm-svn: 337640
      a052206c
    • Yaxun Liu's avatar
      [HIP] Support -fcuda-flush-denormals-to-zero for amdgcn · e1bfbc58
      Yaxun Liu authored
      Differential Revision: https://reviews.llvm.org/D48287
      
      llvm-svn: 337639
      e1bfbc58
    • Peter Collingbourne's avatar
      ELF: Make sections with KeepUnique bit eligible for ICF. · 37f25a24
      Peter Collingbourne authored
      The only restriction is that we cannot merge more than one KeepUnique
      section together. This matches gold's behaviour and reduces code size
      when using --icf=safe.
      
      Differential Revision: https://reviews.llvm.org/D49622
      
      llvm-svn: 337638
      37f25a24
    • Lang Hames's avatar
      [ORC] Re-apply r336760 with fixes. · 960246db
      Lang Hames authored
      llvm-svn: 337637
      960246db
    • JF Bastien's avatar
      [NFC] CodeGen: rename memset to bzero · ed92f608
      JF Bastien authored
      The optimization looks for opportunities to emit bzero, not memset. Rename the functions accordingly (and clang-format the diff) because I want to add a fallback optimization which actually tries to generate memset. bzero is still better and it would confuse the code to merge both.
      
      llvm-svn: 337636
      ed92f608
    • George Karpenkov's avatar
      [Driver] Sanitizer support based on runtime library presence · 8d12fc19
      George Karpenkov authored
      The runtime libraries of sanitizers are built in compiler-rt, and Clang
      can be built without compiler-rt, or compiler-rt can be configured to
      only build certain sanitizers. The driver should provide reasonable
      diagnostics and not a link-time error when a runtime library is missing.
      
      This patch changes the driver for OS X to only support sanitizers of
      which we can find the runtime libraries. The discussion for this patch
      explains the rationale
      
      Differential Revision: https://reviews.llvm.org/D15225
      
      llvm-svn: 337635
      8d12fc19
    • Nico Weber's avatar
      Omit path to lld binary from lld's error, warning, and log output. · bbfe0b79
      Nico Weber authored
      lld currently prepends the absolute path to itself to every diagnostic it
      emits. This path can be longer than the diagnostic, and makes the actual error
      message hard to read.
      
      There isn't a good reason for printing this path: if you want to know which lld
      you're running, pass -v to clang – chances are that if you're unsure of this,
      you're not only unsure when it errors out. Some people want an indication that
      the diagnostic is from the linker though, so instead print just the basename of
      the linker's path.
      
      Before:
      
      ```
      $ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld 
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crt1.o: No such file or directory
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crti.o: No such file or directory
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtbegin.o: No such file or directory
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lc
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtend.o: No such file or directory
      /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtn.o: No such file or directory
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      ```
      
      After:
      
      ```
      $ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld 
      ld.lld: error: cannot open crt1.o: No such file or directory
      ld.lld: error: cannot open crti.o: No such file or directory
      ld.lld: error: cannot open crtbegin.o: No such file or directory
      ld.lld: error: unable to find library -lgcc
      ld.lld: error: unable to find library -lgcc_s
      ld.lld: error: unable to find library -lc
      ld.lld: error: unable to find library -lgcc
      ld.lld: error: unable to find library -lgcc_s
      ld.lld: error: cannot open crtend.o: No such file or directory
      ld.lld: error: cannot open crtn.o: No such file or directory
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      ```
      
      https://reviews.llvm.org/D49189
      
      llvm-svn: 337634
      bbfe0b79
    • Nico Weber's avatar
      Simplify; no behavior change. · f6be4166
      Nico Weber authored
      Reviewed as part of https://reviews.llvm.org/D49189
      
      llvm-svn: 337633
      f6be4166
    • Julie Hockett's avatar
      [clang-doc] Create a script to generate tests · b2180698
      Julie Hockett authored
      Upstreaming the script I use to generate clang-doc tests (and updating
      the existing tests to use it)
      
      Differential Revision: https://reviews.llvm.org/D49268
      
      llvm-svn: 337632
      b2180698
    • Yaxun Liu's avatar
      [HIP] Register/unregister device fat binary only once · f99752b6
      Yaxun Liu authored
      HIP generates one fat binary for all devices after linking. However, for each compilation
      unit a ctor function is emitted which register the same fat binary. Measures need to be
      taken to make sure the fat binary is only registered once.
      
      Currently each ctor function calls __hipRegisterFatBinary and stores the returned value
      to __hip_gpubin_handle. This patch changes the linkage of __hip_gpubin_handle to be linkonce
      so that they are shared between LLVM modules. Then this patch adds check of value of
      __hip_gpubin_handle to make sure __hipRegisterFatBinary is only called once. The code
      is equivalent to
      
      void *_gpubin_handle;
      void ctor() {
        if (__hip_gpubin_handle == 0) {
          __hip_gpubin_handle = __hipRegisterFatBinary(...);
        }
        // register kernels and variables.
      }
      The patch also does similar change to dtors so that __hipUnregisterFatBinary
      is called once.
      
      Differential Revision: https://reviews.llvm.org/D49083
      
      llvm-svn: 337631
      f99752b6