Skip to content
  1. Sep 09, 2016
  2. Sep 08, 2016
  3. Sep 07, 2016
    • Eugene Zelenko's avatar
    • George Burgess IV's avatar
      [Sema] Compare bad conversions in overload resolution. · fbad5b2f
      George Burgess IV authored
      r280553 introduced an issue where we'd emit ambiguity errors for code
      like:
      
      ```
      void foo(int *, int);
      void foo(unsigned int *, unsigned int);
      
      void callFoo() {
        unsigned int i;
        foo(&i, 0); // ambiguous: int->unsigned int is worse than int->int,
                    // but unsigned int*->unsigned int* is better than
                    // int*->int*.
      }
      ```
      
      This patch fixes this issue by changing how we handle ill-formed (but
      valid) implicit conversions. Candidates with said conversions now always
      rank worse than candidates without them, and two candidates are
      considered to be equally bad if they both have these conversions for
      the same argument.
      
      Additionally, this fixes a case in C++11 where we'd complain about an
      ambiguity in a case like:
      
      ```
      void f(char *, int);
      void f(const char *, unsigned);
      void g() { f("abc", 0); }
      ```
      
      ...Since conversion to char* from a string literal is considered
      ill-formed in C++11 (and deprecated in C++03), but we accept it as an
      extension.
      
      llvm-svn: 280847
      fbad5b2f
    • Yaxun Liu's avatar
      Do not validate pch when -fno-validate-pch is set · 43712e05
      Yaxun Liu authored
      There is a bug causing pch to be validated even though -fno-validate-pch is set. This patch fixes it.
      
      ASTReader relies on ASTReaderListener to initialize SuggestedPredefines, which is required for compilations using PCH. Before this change, PCHValidator is the default ASTReaderListener. After this change, when -fno-validate-pch is set, PCHValidator is disabled, but we need a replacement ASTReaderListener to initialize SuggestedPredefines. Class SimpleASTReaderListener is implemented for this purpose.
      
      This change only affects -fno-validate-pch. There is no functional change if -fno-validate-pch is not set.
      
      If -fno-validate-pch is not set, conflicts in predefined macros between pch and current compiler instance causes error.
      
      If -fno-validate-pch is set, predefine macros in current compiler override those in pch so that compilation can continue.
      
      Differential Revision: https://reviews.llvm.org/D24054
      
      llvm-svn: 280842
      43712e05
    • Ismail Pazarbasi's avatar
      Try contextually converting condition of constexpr if to Boolean value · 4a00774e
      Ismail Pazarbasi authored
      Summary:
      C++1z 6.4.1/p2:
       If the if statement is of the form if constexpr, the value of the
       condition shall be a contextually converted constant expression of type
       bool [...]
      C++1z 5.20/p4:
       [...] A contextually converted constant expression of type bool is an
       expression, contextually converted to bool (Clause4), where the
       converted expression is a constant expression and the conversion
       sequence contains only the conversions above. [...]
      
      Contextually converting result of an expression `e` to a Boolean value
      requires `bool t(e)` to be well-formed.
      
      An explicit conversion function is only considered as a user-defined
      conversion for direct-initialization, which is essentially what
      //contextually converted to bool// requires.
      
      Also, fixes PR28470.
      
      Reviewers: rsmith
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D24158
      
      llvm-svn: 280838
      4a00774e
    • Reid Kleckner's avatar
      [MS] Fix prologue this adjustment when 'this' is passed indirectly · e5a321b5
      Reid Kleckner authored
      Move the logic for doing this from the ABI argument lowering into
      EmitParmDecl, which runs for all parameters. Our codegen is slightly
      suboptimal in this case, as we may leave behind a dead store after
      optimization, but it's 32-bit inalloca, and this fixes the bug in a
      robust way.
      
      Fixes PR30293
      
      llvm-svn: 280836
      e5a321b5
    • Reid Kleckner's avatar
      Add MS __nop intrinsic to intrin.h · 5de2bcdc
      Reid Kleckner authored
      Summary: There was no definition for __nop function - added inline
      assembly.
      
      Patch by Albert Gutowski!
      
      Reviewers: rnk, thakis
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D24286
      
      llvm-svn: 280826
      5de2bcdc
    • Reid Kleckner's avatar
      Parsing MS pragma intrinsic · 3f1ec62a
      Reid Kleckner authored
      Parse pragma intrinsic, display warning if the function isn't a builtin
      function in clang and suggest including intrin.h.
      
      Patch by Albert Gutowski!
      
      Reviewers: aaron.ballman, rnk
      
      Subscribers: aaron.ballman, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23944
      
      llvm-svn: 280825
      3f1ec62a
    • Reid Kleckner's avatar
      [MS] Fix 'this' type when calling virtual methods with inalloca · 034e7270
      Reid Kleckner authored
      If the virtual method comes from a secondary vtable, then the type of
      the 'this' parameter should be i8*, and not a pointer to the complete
      class. In the MS ABI, the 'this' parameter on entry points to the vptr
      containing the virtual method that was called, so we use i8* instead of
      the normal type. We had a mismatch where the CGFunctionInfo of the call
      didn't match the CGFunctionInfo of the declaration, and this resulted in
      some assertions, but now both sides agree the type of 'this' is i8*.
      
      Fixes one issue raised in PR30293
      
      llvm-svn: 280815
      034e7270
    • Sagar Thakur's avatar
      [EfficiencySanitizer] [MIPS64] Enables esan clang driver options for MIPS64 · c9113e48
      Sagar Thakur authored
      Reviewed by bruening
      Differential: D23800
      
      llvm-svn: 280806
      c9113e48
    • Alexey Bader's avatar
      [OpenCL] Fix pipe built-in functions return type. · af17c795
      Alexey Bader authored
      By default return type of call expressions calling built-in
      functions is set to bool.
      
      Fixes https://llvm.org/bugs/show_bug.cgi?id=30219.
      
      Reviewers: Anastasia
      
      Subscribers: dmitry, cfe-commits, yaxunl
      
      Differential Revision: https://reviews.llvm.org/D24136
      
      llvm-svn: 280800
      af17c795
    • Matt Arsenault's avatar
      OpenCL: Defining __ENDIAN_LITTLE__ and fix target endianness · f333de37
      Matt Arsenault authored
      OpenCL requires __ENDIAN_LITTLE__ be set for little endian targets.
      The default for targets was also apparently big endian, so AMDGPU
      was incorrectly reported as big endian. Set this from the triple
      so targets don't have another place to set the endianness.
      
      llvm-svn: 280787
      f333de37
    • Matt Arsenault's avatar
      Fix whitespace issues · 8afb5cd8
      Matt Arsenault authored
      ^M and extra space
      
      llvm-svn: 280786
      8afb5cd8
    • Richard Smith's avatar
      Fix clang's handling of the copy performed in the second phase of class · 7c2bcc9e
      Richard Smith authored
      copy-initialization. We previously got this wrong in a couple of ways:
       - we only looked for copy / move constructors and constructor templates for
         this copy, and thus would fail to copy in cases where doing so should use
         some other constructor (but see core issue 670),
       - we mishandled the special case for disabling user-defined conversions that
         blocks infinite recursion through repeated application of a copy constructor
         (applying it in slightly too many cases) -- though as far as I can tell,
         this does not ever actually affect the result of overload resolution, and
       - we misapplied the special-case rules for constructors taking a parameter
         whose type is a (reference to) the same class type by incorrectly assuming
         that only happens for copy/move constructors (it also happens for
         constructors instantiated from templates and those inherited from base
         classes).
      
      These changes should only affect strange corner cases (for instance, where the
      copy constructor exists but has a non-const-qualified parameter type), so for
      the most part it only causes us to produce more 'candidate' notes, but see the
      test changes for other cases whose behavior is affected.
      
      llvm-svn: 280776
      7c2bcc9e
  4. Sep 06, 2016
  5. Sep 05, 2016
  6. Sep 04, 2016
  7. Sep 03, 2016
Loading