Skip to content
  1. Feb 09, 2019
  2. Feb 08, 2019
    • Eli Friedman's avatar
      [Sema] Make string literal init an rvalue. · 3bf72d7d
      Eli Friedman authored
      This allows substantially simplifying the expression evaluation code,
      because we don't have to special-case lvalues which are actually string
      literal initialization.
      
      This currently throws away an optimization where we would avoid creating
      an array APValue for string literal initialization.  If we really want
      to optimize this case, we should fix APValue so it can store simple
      arrays more efficiently, like llvm::ConstantDataArray.  This shouldn't
      affect the memory usage for other string literals.  (Not sure if this is
      a blocker; I don't think string literal init is common enough for this
      to be a serious issue, but I could be wrong.)
      
      The change to test/CodeGenObjC/encode-test.m is a weird side-effect of
      these changes: we currently don't constant-evaluate arrays in C, so the
      strlen call shouldn't be folded, but lvalue string init managed to get
      around that check.  I this this is fine.
      
      Fixes https://bugs.llvm.org/show_bug.cgi?id=40430 .
      
      llvm-svn: 353569
      3bf72d7d
    • George Karpenkov's avatar
      [analyzer] Opt-in C Style Cast Checker for OSObject pointers · 2add627e
      George Karpenkov authored
      Differential Revision: https://reviews.llvm.org/D57261
      
      llvm-svn: 353566
      2add627e
    • Craig Topper's avatar
      [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching... · be4cbe87
      Craig Topper authored
      [X86] Add explicit alignment to __m128/__m128i/__m128d/etc. to allow matching of MSVC behavior with #pragma pack.
      
      Summary:
      With MSVC, #pragma pack is ignored when there is explicit alignment. This differs from gcc. Clang emulates this difference when compiling for Windows.
      
      It appears that MSVC and its headers consider the __m128/__m128i/__m128d/etc. types to be explicitly aligned and ignores #pragma pack for them. Since we don't have explicit alignment on them in our headers, we don't match the MSVC behavior here.
      
      This patch adds explicit alignment to match this behavior. I'm hoping this won't cause any problems when we're not emulating MSVC. But if someone knows of something that would be different we can swith to conditionally adding the alignment based on _MSC_VER.
      
      I had to add explicitly unaligned types as well so we could use them in the loadu/storeu intrinsics which use __attribute__(__packed__). Using the now explicitly aligned types wouldn't produce align 1 accesses when targeting Windows.
      
      Reviewers: rnk, erichkeane, spatel, RKSimon
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57961
      
      llvm-svn: 353555
      be4cbe87
    • Alexey Bataev's avatar
      [OPENMP]Delay emission of the error messages for the exceptions. · c416e647
      Alexey Bataev authored
      Fixed diagnostic emission for the exceptions support in case of the
      compilation of OpenMP code for the devices. From now on, it uses delayed
      diagnostics mechanism, previously used for CUDA only. It allow to
      diagnose not allowed used of exceptions only in functions that are going
      to be codegen'ed.
      
      llvm-svn: 353542
      c416e647
    • Alexey Bataev's avatar
      Revert "[OPENMP]Initial support for the delayed diagnostics." · 346fb4bb
      Alexey Bataev authored
      This reverts commit r353540. Erroneously committed, need to fix the
      message and description.
      
      llvm-svn: 353541
      346fb4bb
    • Alexey Bataev's avatar
      [OPENMP]Initial support for the delayed diagnostics. · 5e62adad
      Alexey Bataev authored
      It is important to delay the emission of the diagnostic messages for the
      functions unless it is proved that the function is going to be used on
      the device side. It is required to support compilation with some of the
      target-specific system headers.
      
      llvm-svn: 353540
      5e62adad
    • James Y Knight's avatar
      [opaque pointer types] Cleanup CGBuilder's Create*GEP. · f5f1b0e5
      James Y Knight authored
      Some of these functions take some extraneous arguments, e.g. EltSize,
      Offset, which are computable from the Type and DataLayout.
      
      Add some asserts to ensure that the computed values are consistent
      with the passed-in values, in preparation for eliminating the
      extraneous arguments. This also asserts that the Type is an Array for
      the calls named "Array" and a Struct for the calls named "Struct".
      
      Then, correct a couple of errors:
      
      1. Using CreateStructGEP on an array type. (this causes the majority
         of the test differences, as struct GEPs are created with i32
         indices, while array GEPs are created with i64 indices)
      
      2. Passing the wrong Offset to CreateStructGEP in TargetInfo.cpp on
         x86-64 NACL (which uses 32-bit pointers).
      
      Differential Revision: https://reviews.llvm.org/D57766
      
      llvm-svn: 353529
      f5f1b0e5
    • JF Bastien's avatar
      Variable auto-init: fix __block initialization · b347e752
      JF Bastien authored
      Summary:
      Automatic initialization [1] of __block variables was trampling over the block's
      headers after they'd been initialized, which caused self-init usage to crash,
      such as here:
      
        typedef struct XYZ { void (^block)(); } *xyz_t;
        __attribute__((noinline))
        xyz_t create(void (^block)()) {
          xyz_t myself = malloc(sizeof(struct XYZ));
          myself->block = block;
          return myself;
        }
        int main() {
          __block xyz_t captured = create(^(){ (void)captured; });
        }
      
      This type of code shouldn't be broken by variable auto-init, even if it's
      sketchy.
      
      [1] With -ftrivial-auto-var-init=pattern
      
      <rdar://problem/47798396>
      
      Reviewers: rjmccall, pcc, kcc
      
      Subscribers: jkorous, dexonsmith, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57797
      
      llvm-svn: 353495
      b347e752
    • Eli Friedman's avatar
      [COFF, ARM64] Fix types for _ReadStatusReg, _WriteStatusReg · 3189d5f4
      Eli Friedman authored
      r344765 added those intrinsics, but used the wrong types.
      
      Patch by Mike Hommey
      
      Differential Revision: https://reviews.llvm.org/D57636
      
      llvm-svn: 353493
      3189d5f4
  3. Feb 07, 2019
  4. Feb 06, 2019
  5. Feb 05, 2019
  6. Feb 04, 2019
  7. Feb 03, 2019
Loading