Skip to content
Snippets Groups Projects
  1. Jan 22, 2018
  2. Jan 21, 2018
  3. Jan 04, 2018
  4. Dec 29, 2017
  5. Dec 14, 2017
    • Aaron Ballman's avatar
      Harmonize GNU- and C++-style attribute spellings. · 8387eb5f
      Aaron Ballman authored
      Most attributes will now use the Clang<"name"> construct to provide both __attribute__((name)) and [[clang::name]] syntaxes for the attribute. Attributes deviating from this should be marked with a comment explaining why they are not supported under both spellings. Common reasons are: the attribute is provided by some other specification that controls the syntax or the attribute cannot be exposed under a particular spelling for some given reason.
      
      Because this is a mechanical change that only introduces new spellings, there are no test cases for the commit.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320752 91177308-0d34-0410-b5e6-96231b3b80d8
      8387eb5f
    • Alex Lorenz's avatar
      [Preprocessor] Implement __is_target_{arch|vendor|os|environment} function-like · d0aceebb
      Alex Lorenz authored
      builtin macros
      
      This patch implements the __is_target_arch, __is_target_vendor, __is_target_os,
      and __is_target_environment Clang preprocessor extensions that were proposed by
      @compnerd in Bob's cfe-dev post:
      http://lists.llvm.org/pipermail/cfe-dev/2017-November/056166.html.
      
      These macros can be used to examine the components of the target triple at
      compile time. A has_builtin(is_target_???) preprocessor check can be used to
      check for their availability.
      
      __is_target_arch allows you to check if an arch is specified without worring
      about a specific subarch, e.g.
      
      __is_target_arch(arm) returns 1 for the target arch "armv7"
      __is_target_arch(armv7) returns 1 for the target arch "armv7"
      __is_target_arch(armv6) returns 0 for the target arch "armv7"
      
      __is_target_vendor and __is_target_environment match the specific vendor
      or environment. __is_target_os matches the specific OS, but
      __is_target_os(darwin) will match any Darwin-based OS. "Unknown" can be used
      to test if the triple's component is specified.
      
      rdar://35753116
      
      Differential Revision: https://reviews.llvm.org/D41087
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320734 91177308-0d34-0410-b5e6-96231b3b80d8
      d0aceebb
  6. Dec 09, 2017
  7. Dec 07, 2017
  8. Dec 05, 2017
  9. Nov 30, 2017
  10. Nov 04, 2017
  11. Oct 27, 2017
    • Nico Weber's avatar
      Use -fuse-init-array if no gcc installation is found. · d724af7f
      Nico Weber authored
      clang currently uses .init_array instead of .ctors on Linux if it detects gcc
      4.7+. Make it so that it also uses .init_array if no gcc installation is found
      at all – if there's no old gcc, there's nothing we need to be compatible with.
      
      icecc for example runs clang in a very small chroot, so before this change
      clang would use .ctors if run under icecc. And lld currently silently mislinks
      inputs with .ctors sections, so before this clang + icecc + lld would produce
      broken binaries. (But this seems like a good change independent of that lld
      bug.)
      
      https://reviews.llvm.org/D39317
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316713 91177308-0d34-0410-b5e6-96231b3b80d8
      d724af7f
  12. Oct 26, 2017
    • Roman Lebedev's avatar
      [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL. · 5f17d5ca
      Roman Lebedev authored
      Summary:
      The warning was initially introduced in D32914 by @thakis,
      and the concerns were raised there, and later in rL302247
      and PR33771.
      
      I do believe that it makes sense to relax the diagnostic
      e.g. in this case, when the expression originates from the
      system header, which can not be modified. This prevents
      adoption for the diagnostic for codebases which use pthreads
      (`PTHREAD_MUTEX_INITIALIZER`), gtest, etc.
      
      As @malcolm.parsons suggests, it *may* make sense to also
      not warn for the template types, but it is not obvious to
      me how to do that in here.
      
      Though, it still makes sense to complain about `NULL` macro.
      
      While there, add more tests.
      
      Reviewers: dblaikie, thakis, rsmith, rjmccall, aaron.ballman
      
      Reviewed By: thakis
      
      Subscribers: Rakete1111, hans, cfe-commits, thakis, malcolm.parsons
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D38954
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316662 91177308-0d34-0410-b5e6-96231b3b80d8
      5f17d5ca
  13. Oct 24, 2017
    • Roman Lebedev's avatar
      [Sema] Document+test the -Wsign-compare change for enums in C code [NFC] · 05b3b1db
      Roman Lebedev authored
      rL316268 / D39122 has fixed PR35009, and now when in C,
      these three(?) diagnostics properly use the enum's underlying
      datatype.
      
      While it was fixed, the test coverage was clearly insufficient,
      because the -Wsign-compare change didn't show up in any of the
      tests, until it was reported in the post-commit mail for rL316268.
      
      So add the test for the -Wsign-compare diagnostic for enum
      for C code, and while there, document this in the release notes.
      
      The fix itself was obviously correct, so unless we want to silence
      this new diagnosed case, i deem this commit to be NFC.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316500 91177308-0d34-0410-b5e6-96231b3b80d8
      05b3b1db
  14. Oct 21, 2017
  15. Oct 15, 2017
  16. Oct 13, 2017
    • Roman Lebedev's avatar
      Revert "[Sema] Diagnose tautological comparison with type's min/max values" · 720ba14b
      Roman Lebedev authored
      This reverts r315614,r315615,r315621,r315622
      Breaks http://bb9.pgr.jp/#/builders/20/builds/59
      
      /home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:95:17: error: comparison 'long long' > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare]
          if (max_sec > Lim::max()) return false;
              ~~~~~~~ ^ ~~~~~~~~~~
      /home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:124:13: error: comparison 'long long' < -9223372036854775808 is always false [-Werror,-Wtautological-constant-compare]
          if (sec < Lim::min() || sec > Lim::max())   return false;
              ~~~ ^ ~~~~~~~~~~
      /home/bb9/bootstrap-clang-libcxx-lld-i686-linux/llvm-project/libcxx/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp:124:33: error: comparison 'long long' > 9223372036854775807 is always false [-Werror,-Wtautological-constant-compare]
          if (sec < Lim::min() || sec > Lim::max())   return false;
                                  ~~~ ^ ~~~~~~~~~~
      3 errors generated.
      --
      
      I'm not yet sure what is the proper fix.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315631 91177308-0d34-0410-b5e6-96231b3b80d8
      720ba14b
  17. Oct 12, 2017
  18. Oct 06, 2017
  19. Sep 28, 2017
  20. Sep 11, 2017
  21. Sep 08, 2017
  22. Sep 05, 2017
  23. Aug 30, 2017
  24. Aug 25, 2017
  25. Aug 12, 2017
  26. Aug 11, 2017
  27. Aug 08, 2017
  28. Aug 02, 2017
    • Vedant Kumar's avatar
      [ubsan] Have -fsanitize=vptr emit a null check if -fsanitize=null isn't available · 63a4e484
      Vedant Kumar authored
      In r309007, I made -fsanitize=null a hard prerequisite for -fsanitize=vptr. I
      did not see the need for the two checks to have separate null checking logic
      for the same pointer. I expected the two checks to either always be enabled
      together, or to be mutually compatible.
      
      In the mailing list discussion re: r309007 it became clear that that isn't the
      case. If a codebase is -fsanitize=vptr clean but not -fsanitize=null clean,
      it's useful to have -fsanitize=vptr emit its own null check. That's what this
      patch does: with it, -fsanitize=vptr can be used without -fsanitize=null.
      
      Differential Revision: https://reviews.llvm.org/D36112
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309846 91177308-0d34-0410-b5e6-96231b3b80d8
      63a4e484
    • Manuel Klimek's avatar
      Unify and simplify the behavior of the hasDeclaration matcher. · 81937d82
      Manuel Klimek authored
      Originally, we weren't able to match on Type nodes themselves (only QualType),
      so the hasDeclaration matcher was initially written to give what we thought are
      reasonable results for QualType matches.
      
      When we chagned the matchers to allow matching on Type nodes, it turned out
      that the hasDeclaration matcher was by chance written templated enough to now
      allow hasDeclaration to also match on (some) Type nodes.
      
      This patch change the hasDeclaration matcher to:
      a) work the same on Type and QualType nodes,
      b) be completely explicit about what nodes we can match instead of just allowing
         anything with a getDecl() to match,
      c) explicitly control desugaring only one level in very specific instances.
      d) adds hasSpecializedTemplate and tagType matchers to allow migrating
        existing use cases that now need more explicit matchers
      
      Note: This patch breaks clang-tools-extra. The corresponding patch there
      is approved and will land in a subsequent patch.
      
      Differential Revision: https://reviews.llvm.org/D27104
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309809 91177308-0d34-0410-b5e6-96231b3b80d8
      81937d82
  29. Jul 31, 2017
  30. Jul 26, 2017
  31. Jul 25, 2017
  32. Jul 19, 2017
  33. Jul 14, 2017
  34. Jul 03, 2017
  35. Jul 01, 2017
  36. Jun 13, 2017
Loading