r306291 - Improve const-correctness.
Author: axel Date: Mon Jun 26 08:06:40 2017 New Revision: 306291 URL: http://llvm.org/viewvc/llvm-project?rev=306291&view=rev Log: Improve const-correctness. Modified: cfe/trunk/include/clang/Parse/Parser.h Modified: cfe/trunk/include/clang/Parse/Parser.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=306291&r1=306290&r2=306291&view=diff == --- cfe/trunk/include/clang/Parse/Parser.h (original) +++ cfe/trunk/include/clang/Parse/Parser.h Mon Jun 26 08:06:40 2017 @@ -604,7 +604,7 @@ public: } /// getTypeAnnotation - Read a parsed type out of an annotation token. - static ParsedType getTypeAnnotation(Token &Tok) { + static ParsedType getTypeAnnotation(const Token &Tok) { return ParsedType::getFromOpaquePtr(Tok.getAnnotationValue()); } @@ -615,7 +615,7 @@ private: /// \brief Read an already-translated primary expression out of an annotation /// token. - static ExprResult getExprAnnotation(Token &Tok) { + static ExprResult getExprAnnotation(const Token &Tok) { return ExprResult::getFromOpaquePointer(Tok.getAnnotationValue()); } ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r351701 - Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...>
Hi, This broke our clang builds with $ gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) on CentOS Linux release 7.6.1810 (Core), [ 23%] Building CXX object tools/clang/lib/Basic/CMakeFiles/clangBasic.dir/Module.cpp.o In file included from include/llvm/ADT/StringMap.h:20:0, from include/llvm/Support/Host.h:16, from include/llvm/ADT/Hashing.h:48, from include/llvm/ADT/ArrayRef.h:12, from include/llvm/ADT/DenseMapInfo.h:16, from include/llvm/ADT/DenseMap.h:16, from tools/clang/include/clang/Basic/FileManager.h:19, from tools/clang/include/clang/Basic/Module.h:18, from tools/clang/lib/Basic/Module.cpp:14: include/llvm/Support/PointerLikeTypeTraits.h: In instantiation of ‘struct llvm::PointerLikeTypeTraits’: /usr/include/c++/4.8.2/type_traits:1087:41: required by substitution of ‘template static decltype (((declval<_Tp1>)()=(declval<_Up1>)(), std::__sfinae_types::__one())) std::__is_assignable_helper<_Tp, _Up>::__test(int) [with _Tp1 = _Tp1; _Up1 = _Up1; _Tp = llvm::detail::trivial_helper >&; _Up = const llvm::detail::trivial_helper >&] [with _Tp1 = llvm::detail::trivial_helper >&; _Up1 = const llvm::detail::trivial_helper >&]’ /usr/include/c++/4.8.2/type_traits:1094:50: required from ‘constexpr const bool std::__is_assignable_helper >&, const llvm::detail::trivial_helper >&>::value’ /usr/include/c++/4.8.2/type_traits:1099:12: required from ‘struct std::is_assignable >&, const llvm::detail::trivial_helper >&>’ /usr/include/c++/4.8.2/type_traits:1112:12: required from ‘struct std::__is_copy_assignable_impl >, false>’ /usr/include/c++/4.8.2/type_traits:1118:12: required from ‘struct std::is_copy_assignable > >’ include/llvm/Support/type_traits.h:142:25: required from ‘constexpr const bool llvm::is_trivially_copyable >::has_trivial_copy_assign’ include/llvm/Support/type_traits.h:163:32: required from ‘constexpr const bool llvm::is_trivially_copyable >::value’ include/llvm/ADT/SmallVector.h:321:7: required from ‘class llvm::SmallVectorImpl >’ include/llvm/ADT/SmallVector.h:845:7: required from ‘class llvm::SmallVector, 2u>’ tools/clang/include/clang/Basic/Module.h:290:30: required from here include/llvm/Support/PointerLikeTypeTraits.h:59:8: error: invalid application of ‘__alignof__’ to incomplete type ‘clang::Module’ enum { NumLowBitsAvailable = detail::ConstantLog2::value }; ^ FYI in case you wonder: $ ls -l /usr/include/c++/ total 8 drwxr-xr-x. 12 root root 4096 Dec 11 03:24 4.8.2 lrwxrwxrwx. 1 root root5 Dec 11 03:24 4.8.5 -> 4.8.2 Are we outside the "allowed" range for GCC versions? Cheers, Axel. On 1/20/19 10:19 PM, Serge Guelton via cfe-commits wrote: > Author: serge_sans_paille > Date: Sun Jan 20 13:19:56 2019 > New Revision: 351701 > > URL: http://llvm.org/viewvc/llvm-project?rev=351701&view=rev > Log: > Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> > > As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the specialization > for > isPodLike> did not match the expectation of > std::is_trivially_copyable which makes the memcpy optimization invalid. > > This patch renames the llvm::isPodLike trait into llvm::is_trivially_copyable. > Unfortunately std::is_trivially_copyable is not portable across compiler / STL > versions. So a portable version is provided too. > > Note that the following specialization were invalid: > > std::pair > llvm::Optional > > Tests have been added to assert that former specialization are respected by > the > standard usage of llvm::is_trivially_copyable, and that when a decent version > of std::is_trivially_copyable is available, llvm::is_trivially_copyable is > compared to std::is_trivially_copyable. > > As of this patch, llvm::Optional is no longer considered trivially copyable, > even if T is. This is to be fixed in a later patch, as it has impact on a > long-running bug (see r347004) > > Note that GCC warns about this UB, but this got silented by > https://reviews.llvm.org/D50296. > > Differential Revision: https://reviews.llvm.org/D54472 > > > Modified: > cfe/trunk/include/clang/AST/BaseSubobject.h > cfe/trunk/include/clang/AST/CharUnits.h > cfe/trunk/include/clang/AST/DeclAccessPair.h > cfe/trunk/include/clang/AST/DeclarationName.h > cfe/trunk/include/clang/AST/ExprObjC.h > cfe/trunk/include/clang/AST/GlobalDecl.h > cfe/trunk/include/clang/AST/Type.h > cfe/trunk/include/clang/Analysis/ProgramPoint.h > cfe/trunk/include/clang/Basic/IdentifierTable.h > cfe/trunk/include/clang/Basic/SourceLocation.h > cfe/trunk/include/clang/Lex/Token.h > cfe/trunk/include/clang/Sema/CodeCompleteConsumer.h > cfe/trunk/include/clang/Sema/Ownership.h > cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h > cfe/trunk/lib/AST/VTableBuilder.cpp > cfe/trunk/lib/Sema/SemaChecking.cpp > cfe/t
Re: r351701 - Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...>
This got fixed in r351820. Thanks, Serge! Axel. On 1/23/19 5:56 AM, Hubert Tong wrote: > I am also hitting this. GCC 4.8 is still the minimum at this time. > > -- HT > > On Tue, Jan 22, 2019 at 8:10 AM Axel Naumann via cfe-commits > mailto:cfe-commits@lists.llvm.org>> wrote: > > Hi, > > This broke our clang builds with > > $ gcc --version > gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36) > > on CentOS Linux release 7.6.1810 (Core), > > [ 23%] Building CXX object > tools/clang/lib/Basic/CMakeFiles/clangBasic.dir/Module.cpp.o > > In file included from include/llvm/ADT/StringMap.h:20:0, > from include/llvm/Support/Host.h:16, > from include/llvm/ADT/Hashing.h:48, > from include/llvm/ADT/ArrayRef.h:12, > from include/llvm/ADT/DenseMapInfo.h:16, > from include/llvm/ADT/DenseMap.h:16, > from > tools/clang/include/clang/Basic/FileManager.h:19, > from tools/clang/include/clang/Basic/Module.h:18, > from tools/clang/lib/Basic/Module.cpp:14: > include/llvm/Support/PointerLikeTypeTraits.h: In instantiation of > ‘struct llvm::PointerLikeTypeTraits’: > /usr/include/c++/4.8.2/type_traits:1087:41: required by substitution > of ‘template static decltype > (((declval<_Tp1>)()=(declval<_Up1>)(), std::__sfinae_types::__one())) > std::__is_assignable_helper<_Tp, _Up>::__test(int) [with _Tp1 = _Tp1; > _Up1 = _Up1; _Tp = > llvm::detail::trivial_helper bool> >&; _Up = const > llvm::detail::trivial_helper bool> >&] [with _Tp1 = > llvm::detail::trivial_helper bool> >&; _Up1 = const > llvm::detail::trivial_helper bool> >&]’ > /usr/include/c++/4.8.2/type_traits:1094:50: required from ‘constexpr > const bool > > std::__is_assignable_helper 1u, bool> >&, const > llvm::detail::trivial_helper bool> >&>::value’ > /usr/include/c++/4.8.2/type_traits:1099:12: required from ‘struct > > std::is_assignable 1u, bool> >&, const > llvm::detail::trivial_helper bool> >&>’ > /usr/include/c++/4.8.2/type_traits:1112:12: required from ‘struct > > std::__is_copy_assignable_impl 1u, bool> >, false>’ > /usr/include/c++/4.8.2/type_traits:1118:12: required from ‘struct > > std::is_copy_assignable 1u, bool> > >’ > include/llvm/Support/type_traits.h:142:25: required from ‘constexpr > const bool > llvm::is_trivially_copyable bool> >::has_trivial_copy_assign’ > include/llvm/Support/type_traits.h:163:32: required from ‘constexpr > const bool > llvm::is_trivially_copyable bool> >::value’ > include/llvm/ADT/SmallVector.h:321:7: required from ‘class > llvm::SmallVectorImpl bool> >’ > include/llvm/ADT/SmallVector.h:845:7: required from ‘class > llvm::SmallVector, 2u>’ > tools/clang/include/clang/Basic/Module.h:290:30: required from here > include/llvm/Support/PointerLikeTypeTraits.h:59:8: error: invalid > application of ‘__alignof__’ to incomplete type ‘clang::Module’ > enum { NumLowBitsAvailable = > detail::ConstantLog2::value }; > ^ > > FYI in case you wonder: > > $ ls -l /usr/include/c++/ > total 8 > drwxr-xr-x. 12 root root 4096 Dec 11 03:24 4.8.2 > lrwxrwxrwx. 1 root root 5 Dec 11 03:24 4.8.5 -> 4.8.2 > > > Are we outside the "allowed" range for GCC versions? > > Cheers, Axel. > > On 1/20/19 10:19 PM, Serge Guelton via cfe-commits wrote: > > Author: serge_sans_paille > > Date: Sun Jan 20 13:19:56 2019 > > New Revision: 351701 > > > > URL: http://llvm.org/viewvc/llvm-project?rev=351701&view=rev > > Log: > > Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> > > > > As noted in https://bugs.llvm.org/show_bug.cgi?id=36651, the > specialization for > > isPodLike> did not match the expectation of > > std::is_trivially_copyable which makes the memcpy optimization > invalid. > > > > This patch renames the llvm::isPodLike trait into > llvm::is_trivially_copyable. > > Unfortunately std::is_trivially_copyable is not portable across > compiler / STL > > versions. So a portable version is provided too. > > > > Note that the following specialization were invalid: >
r287633 - Missing initializer.
Author: axel Date: Tue Nov 22 04:00:23 2016 New Revision: 287633 URL: http://llvm.org/viewvc/llvm-project?rev=287633&view=rev Log: Missing initializer. Modified: cfe/trunk/include/clang/AST/DeclFriend.h Modified: cfe/trunk/include/clang/AST/DeclFriend.h URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DeclFriend.h?rev=287633&r1=287632&r2=287633&view=diff == --- cfe/trunk/include/clang/AST/DeclFriend.h (original) +++ cfe/trunk/include/clang/AST/DeclFriend.h Tue Nov 22 04:00:23 2016 @@ -82,6 +82,7 @@ private: FriendDecl(EmptyShell Empty, unsigned NumFriendTypeTPLists) : Decl(Decl::Friend, Empty), NextFriend(), + UnsupportedFriend(false), NumTPLists(NumFriendTypeTPLists) { } FriendDecl *getNextFriend() { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r259637 - Reduce initial Sema memory consumption by 400KB. By Elisavet Sakellari.
Author: axel Date: Wed Feb 3 04:45:22 2016 New Revision: 259637 URL: http://llvm.org/viewvc/llvm-project?rev=259637&view=rev Log: Reduce initial Sema memory consumption by 400KB. By Elisavet Sakellari. Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=259637&r1=259636&r2=259637&view=diff == --- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original) +++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Wed Feb 3 04:45:22 2016 @@ -123,7 +123,7 @@ private: CancelRegion(false), AssociatedLoops(1), InnerTeamsRegionLoc() {} }; - typedef SmallVector StackTy; + typedef SmallVector StackTy; /// \brief Stack of used declaration and their data-sharing attributes. StackTy Stack; ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D16801: [OpenMP] Change in initial size of DSAStackTy::StackTy
karies added a subscriber: karies. karies closed this revision. karies added a comment. Committed as r259637 http://reviews.llvm.org/D16801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D16923: [AST] Implemented missing VisitAccessSpecDecl function in ASTImporter class.
karies added reviewers: klimek, bkramer. karies added a comment. Because of previous review subscriptions... http://reviews.llvm.org/D16923 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D17820: Clang Code Completion Filtering
karies added a comment. Regarding the concerns raised by @akyrtzi : maybe it's a question of making the completer interface useful at low cost (with filtering for generic use cases and less ASTReading) versus not breaking existing use cases (fuzzy match). Would you still object to this change if the filtering could be disabled in the CodeCompleteConsumer? Repository: rL LLVM http://reviews.llvm.org/D17820 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits