Skip to content
  1. Feb 09, 2019
  2. Feb 08, 2019
    • Eli Friedman's avatar
      [CodeGen][NFC] Update comments in CGExprConstant.cpp. · 7f98e3c2
      Eli Friedman authored
      llvm-svn: 353571
      7f98e3c2
    • 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
    • Adrian Prantl's avatar
      Fix typo · 57e60a50
      Adrian Prantl authored
      llvm-svn: 353568
      57e60a50
    • 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
    • Akira Hatanaka's avatar
      Pass the base element type of an array type to the visit method instead · 67b1b451
      Akira Hatanaka authored
      of the array type itself.
      
      This fixes a bug found by inspection that was introduced in r353459. I
      don't have a test case for this since we don't yet have types that would
      make the containing C struct non-trivial to copy/move but wouldn't make
      it non-trivial to default-initialize or destruct.
      
      llvm-svn: 353556
      67b1b451
    • 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
    • Yitzhak Mandelbaum's avatar
      [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers. · 8a436802
      Yitzhak Mandelbaum authored
      Specifically:
      
      * fixes the comments on `hasObjectExpression`,
      * clarifies comments on `thisPointerType` and `on`,
      * adds comments to `onImplicitObjectArgument`.
      
      It also updates associated reference docs (using the doc tool).
      
      Reviewers: alexfh, steveire, aaron.ballman
      
      Differential Revision: https://reviews.llvm.org/D56849
      
      llvm-svn: 353532
      8a436802
    • Ben Hamilton's avatar
      [Format/ObjC] Fix [foo bar]->baz formatting as lambda arrow · 30b7d09d
      Ben Hamilton authored
      Summary:
      Currently, `UnwrappedLineParser` thinks an arrow token after
      an ObjC method expression is a C++ lambda arrow, so it formats:
      
      ```
      [foo bar]->baz
      ```
      
      as:
      
      ```
      [foo bar] -> baz
      ```
      
      Because `UnwrappedLineParser` runs before `TokenAnnotator`, it can't
      know if the arrow token is after an ObjC method expression or not.
      
      This diff makes `TokenAnnotator` remove the TT_LambdaArrow on
      the arrow token if it follows an ObjC method expression.
      
      Test Plan: New test added. Ran test with:
        % ninja FormatTests && ./tools/clang/unittests/Format/FormatTests
        Confirmed test failed before diff and passed after diff.
      
      Reviewers: krasimir, djasper, sammccall
      
      Reviewed By: sammccall
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57923
      
      llvm-svn: 353531
      30b7d09d
    • 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
    • Gabor Marton's avatar
      [ASTImporter][ASTImporterSpecificLookup] Add test for different operators · a9cab318
      Gabor Marton authored
      Summary:
      This is to check that operators are handled properly in
      `ASTImporterSpecificLookup`.  Note, this lookup table is not used in LLDB, only
      in CTU.
      
      Reviewers: a_sidorin, shafik, a.sidorin
      
      Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57905
      
      llvm-svn: 353505
      a9cab318
    • Gabor Marton's avatar
      [AST] Fix structural inequivalence of operators · fc638d64
      Gabor Marton authored
      Summary: Operators kind was not checked, so we reported e.g. op- to be equal with op+
      
      Reviewers: shafik, a_sidorin, aaron.ballman
      
      Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57902
      
      llvm-svn: 353504
      fc638d64
    • 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
    • JF Bastien's avatar
      [NFC] Variable auto-init: use getAsVariableArrayType helper · ddeb2f2a
      JF Bastien authored
      As suggested by @rjmccall in D57797.
      
      llvm-svn: 353490
      ddeb2f2a
  3. Feb 07, 2019
  4. Feb 06, 2019
Loading