Skip to content
Snippets Groups Projects
  1. Sep 12, 2016
  2. Sep 09, 2016
  3. Sep 08, 2016
  4. Sep 07, 2016
    • George Burgess IV's avatar
      [Sema] Compare bad conversions in overload resolution. · 2cef254a
      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.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280847 91177308-0d34-0410-b5e6-96231b3b80d8
      2cef254a
    • Yaxun Liu's avatar
      Do not validate pch when -fno-validate-pch is set · 2807f026
      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
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280842 91177308-0d34-0410-b5e6-96231b3b80d8
      2807f026
    • Vassil Vassilev's avatar
      Add missing include. White space. · 99ad38fd
      Vassil Vassilev authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280827 91177308-0d34-0410-b5e6-96231b3b80d8
      99ad38fd
    • Reid Kleckner's avatar
      Parsing MS pragma intrinsic · 7dee30fb
      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
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280825 91177308-0d34-0410-b5e6-96231b3b80d8
      7dee30fb
    • Matt Arsenault's avatar
      OpenCL: Defining __ENDIAN_LITTLE__ and fix target endianness · f144d8ba
      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.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280787 91177308-0d34-0410-b5e6-96231b3b80d8
      f144d8ba
  5. Sep 04, 2016
  6. Sep 03, 2016
  7. Sep 02, 2016
    • Eric Fiselier's avatar
      Implement __attribute__((require_constant_initialization)) for safe static initialization. · 89aa3ede
      Eric Fiselier authored
      Summary:
      This attribute specifies expectations about the initialization of static and
      thread local variables. Specifically that the variable has a
      [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization)
      according to the rules of [basic.start.static]. Failure to meet this expectation
      will result in an error.
      
      Static objects with constant initializers avoid hard-to-find bugs caused by
      the indeterminate order of dynamic initialization. They can also be safely
      used by other static constructors across translation units.
      
      This attribute acts as a compile time assertion that the requirements
      for constant initialization have been met. Since these requirements change
      between dialects and have subtle pitfalls it's important to fail fast instead
      of silently falling back on dynamic initialization.
      
      ```c++
        // -std=c++14
        #define SAFE_STATIC __attribute__((require_constant_initialization)) static
        struct T {
          constexpr T(int) {}
          ~T();
        };
        SAFE_STATIC T x = {42}; // OK.
        SAFE_STATIC T y = 42; // error: variable does not have a constant initializer
        // copy initialization is not a constant expression on a non-literal type.
      ```
      This attribute can only be applied to objects with static or thread-local storage
      duration.
      
      Reviewers: majnemer, rsmith, aaron.ballman
      
      Subscribers: jroelofs, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23385
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280525 91177308-0d34-0410-b5e6-96231b3b80d8
      89aa3ede
    • Eric Fiselier's avatar
      Revert r280516 since it contained accidental changes. · f92a8d01
      Eric Fiselier authored
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280521 91177308-0d34-0410-b5e6-96231b3b80d8
      f92a8d01
    • Eric Fiselier's avatar
      Implement __attribute__((require_constant_initialization)) for safe static initialization. · 85fb4f5d
      Eric Fiselier authored
      Summary:
      This attribute specifies expectations about the initialization of static and
      thread local variables. Specifically that the variable has a
      [constant initializer](http://en.cppreference.com/w/cpp/language/constant_initialization)
      according to the rules of [basic.start.static]. Failure to meet this expectation
      will result in an error.
      
      Static objects with constant initializers avoid hard-to-find bugs caused by
      the indeterminate order of dynamic initialization. They can also be safely
      used by other static constructors across translation units.
      
      This attribute acts as a compile time assertion that the requirements
      for constant initialization have been met. Since these requirements change
      between dialects and have subtle pitfalls it's important to fail fast instead
      of silently falling back on dynamic initialization.
      
      ```c++
        // -std=c++14
        #define SAFE_STATIC __attribute__((require_constant_initialization)) static
        struct T {
          constexpr T(int) {}
          ~T();
        };
        SAFE_STATIC T x = {42}; // OK.
        SAFE_STATIC T y = 42; // error: variable does not have a constant initializer
        // copy initialization is not a constant expression on a non-literal type.
      ```
      This attribute can only be applied to objects with static or thread-local storage
      duration.
      
      Reviewers: majnemer, rsmith, aaron.ballman
      
      Subscribers: jroelofs, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D23385
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280516 91177308-0d34-0410-b5e6-96231b3b80d8
      85fb4f5d
    • Aaron Ballman's avatar
      Allow a C11 generic selection expression to select a function with the... · 7453511a
      Aaron Ballman authored
      Allow a C11 generic selection expression to select a function with the overloadable attribute as the result expression without crashing. This fixes PR30201.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280483 91177308-0d34-0410-b5e6-96231b3b80d8
      7453511a
  8. Sep 01, 2016
    • Richard Smith's avatar
      When we reach the end of a #include of a header of a local submodule that we · 7e8dc8a5
      Richard Smith authored
      textually included, create an ImportDecl just as we would if we reached a
      #include of any other modular header. This is necessary in order to correctly
      determine the set of variables to initialize for an imported module.
      
      This should hopefully make the modules selfhost buildbot green again.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280409 91177308-0d34-0410-b5e6-96231b3b80d8
      7e8dc8a5
    • Aleksei Sidorin's avatar
      [analyzer] ExprEngine: remove second call to PreStmt<CastExpr> · 88f65ed9
      Aleksei Sidorin authored
      This patch also introduces AnalysisOrderChecker which is intended for testing
      of callback call correctness.
      
      Differential Revision: https://reviews.llvm.org/D23804
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280367 91177308-0d34-0410-b5e6-96231b3b80d8
      88f65ed9
    • Richard Smith's avatar
      DR259: Demote the pedantic error for an explicit instantiation after an · f3b78ea7
      Richard Smith authored
      explicit specialization to a warning for C++98 mode (this is a defect report
      resolution, so per our informal policy it should apply in C++98), and turn
      the warning on by default for C++11 and later. In all cases where it fires, the
      right thing to do is to remove the pointless explicit instantiation.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280308 91177308-0d34-0410-b5e6-96231b3b80d8
      f3b78ea7
    • Nick Lewycky's avatar
      Add -fprofile-dir= to clang. · 1051c8ca
      Nick Lewycky authored
      -fprofile-dir=path allows the user to specify where .gcda files should be
      emitted when the program is run. In particular, this is the first flag that
      causes the .gcno and .o files to have different paths, LLVM is extended to
      support this. -fprofile-dir= does not change the file name in the .gcno (and
      thus where lcov looks for the source) but it does change the name in the .gcda
      (and thus where the runtime library writes the .gcda file). It's different from
      a GCOV_PREFIX because a user can observe that the GCOV_PREFIX_STRIP will strip
      paths off of -fprofile-dir= but not off of a supplied GCOV_PREFIX.
      
      To implement this we split -coverage-file into -coverage-data-file and
      -coverage-notes-file to specify the two different names. The !llvm.gcov
      metadata node grows from a 2-element form {string coverage-file, node dbg.cu}
      to 3-elements, {string coverage-notes-file, string coverage-data-file, node
      dbg.cu}. In the 3-element form, the file name is already "mangled" with
      .gcno/.gcda suffixes, while the 2-element form left that to the middle end
      pass.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@280306 91177308-0d34-0410-b5e6-96231b3b80d8
      1051c8ca
  9. Aug 31, 2016
  10. Aug 30, 2016
Loading