Re: [PATCH] D11859: Generating vptr assume loads
rjmccall added a comment. Mostly LGTM. Are you going to emit assumptions for vbptrs in a separate patch? Comment at: lib/CodeGen/CGCXXABI.h:349-357 @@ -348,1 +348,11 @@ + /// Checks if ABI requires extra virtual offset for vtable field. + virtual bool + isVirtualOffsetNeededForVTableField(CodeGenFunction &CGF, + const CXXRecordDecl *NearestVBase) = 0; + + /// Checks if ABI allows to initilize vptr for given class. + virtual bool canInitializeVPtr(const CXXRecordDecl *VTableClass, + const CXXRecordDecl *Base, + const CXXRecordDecl *NearestVBase) = 0; + In contrast, this does not need to be as general as it is, and making it this general is actively harmful; just pass the vtable class. Also, I suggest calling it "doStructorsInitializeVTables". Comment at: lib/CodeGen/CGCXXABI.h:352 @@ +351,3 @@ + isVirtualOffsetNeededForVTableField(CodeGenFunction &CGF, + const CXXRecordDecl *NearestVBase) = 0; + This method does not need to be passed a CodeGenFunction&, but it should take a complete CodeGenFunction::VPtr, not just this one random field from it. Comment at: lib/CodeGen/CGClass.cpp:1862 @@ +1861,3 @@ + for (const VPtr &vptr : getVTablePointers(ClassDecl)) +if (CGM.getCXXABI().canInitializeVPtr(vptr.VTableClass, vptr.Base.getBase(), + vptr.NearestVBase)) As mentioned elsewhere, you can skip this entire loop if doStructorsInitializeVTables returns false. Comment at: lib/CodeGen/CGClass.cpp:2157 @@ +2156,3 @@ +if (CGM.getCXXABI().canInitializeVPtr(Vptr.VTableClass, Vptr.Base.getBase(), + Vptr.NearestVBase)) + InitializeVTablePointer(Vptr); Please call doStructorsInitializeVTables for RD above the call to getVTablePointers and then just skip the rest of the function if it returns false. http://reviews.llvm.org/D11859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12047: test/SemaObjC: Remove cruft in unused getter test
AlexDenisov added a subscriber: AlexDenisov. AlexDenisov added a comment. Why do you think it's a cruft? Seems it's a bit more verbose than it should be, but what is missing in your test is inheritance, which is important. P.S. I think the code for the initial test was just extracted from a real project. http://reviews.llvm.org/D12047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11859: Generating vptr assume loads
majnemer added inline comments. Comment at: test/CodeGenCXX/vtable-assume-load.cpp:40 @@ +39,3 @@ +// CHECK1: call void @llvm.assume(i1 %cmp.vtables) +// CHECK1-LABLE: } + This check line looks misspelled. http://reviews.llvm.org/D11859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [clang-tools-extra] r245052 - [clang-tidy] Move IncludeSorter.* and IncludeInserter.* to clang-tidy/utils/
Looks fixed now, thanks! On Sat, Aug 15, 2015 at 8:41 AM, Alexander Kornienko wrote: > ... or this may have been fixed by r245144. In any case, please check again > and report if anything is still broken. > > > On Sat, Aug 15, 2015 at 7:39 AM, Alexander Kornienko > wrote: >> >> Sorry for not posting an update earlier. >> >> I can't reproduce the build failure, and I see no build bots failing in a >> similar way. Must be something with your local configuration. >> >> >> On Fri, Aug 14, 2015 at 7:47 PM, Alexander Kornienko >> wrote: >>> >>> Strange. No build bots complained about this so far. I'll take a look at >>> this in an hour or so. >>> >>> On 14 Aug 2015 19:42, "İsmail Dönmez" wrote: Hi, On Fri, Aug 14, 2015 at 5:31 PM, Alexander Kornienko via cfe-commits wrote: > Author: alexfh > Date: Fri Aug 14 09:31:31 2015 > New Revision: 245052 > > URL: http://llvm.org/viewvc/llvm-project?rev=245052&view=rev > Log: > [clang-tidy] Move IncludeSorter.* and IncludeInserter.* to > clang-tidy/utils/ > > This is better structurally and it also fixes a linker error in the > configure > build. This seems to break cmake build on Linux: FAILED: : && /home/abuild/rpmbuild/BUILD/llvm/stage1/bin/clang++ -fPIC -fuse-ld=gold -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Werror=date-time -std=c++11 -fcolor-diagnostics -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -Wno-nested-anon-types -O2 -g -stdlib=libc++ -Wl,-z,defs -Wl,-O3 -Wl,--gc-sections -shared -Wl,-soname,libclangTidyModernizeModule.so.3.8 -o lib64/libclangTidyModernizeModule.so.3.8.0svn tools/clang/tools/extra/clang-tidy/modernize/CMakeFiles/clangTidyModernizeModule.dir/ModernizeTidyModule.cpp.o tools/clang/tools/extra/clang-tidy/modernize/CMakeFiles/clangTidyModernizeModule.dir/PassByValueCheck.cpp.o lib64/libclangAST.so.3.8.0svn lib64/libclangASTMatchers.so.3.8.0svn lib64/libclangBasic.so.3.8.0svn lib64/libclangLex.so.3.8.0svn lib64/libclangTidy.so.3.8.0svn lib64/libclangTidyReadabilityModule.so.3.8.0svn lib64/libLLVMSupport.so.3.8.0svn -Wl,-rpath,"\$ORIGIN/../lib64" && : ../tools/clang/tools/extra/clang-tidy/modernize/PassByValueCheck.cpp:169: error: undefined reference to 'clang::tidy::IncludeInserter::IncludeInserter(clang::SourceManager const&, clang::LangOptions const&, clang::tidy::IncludeSorter::IncludeStyle)' /home/abuild/rpmbuild/BUILD/llvm/stage1/bin/../include/c++/v1/memory:2516: error: undefined reference to 'clang::tidy::IncludeInserter::~IncludeInserter()' ../tools/clang/tools/extra/clang-tidy/modernize/PassByValueCheck.cpp:171: error: undefined reference to 'clang::tidy::IncludeInserter::CreatePPCallbacks()' ../tools/clang/tools/extra/clang-tidy/modernize/PassByValueCheck.cpp:215: error: undefined reference to 'clang::tidy::IncludeInserter::CreateIncludeInsertion(clang::FileID, llvm::StringRef, bool)' /home/abuild/rpmbuild/BUILD/llvm/stage1/bin/../include/c++/v1/memory:2516: error: undefined reference to 'clang::tidy::IncludeInserter::~IncludeInserter()' /home/abuild/rpmbuild/BUILD/llvm/stage1/bin/../include/c++/v1/memory:2516: error: undefined reference to 'clang::tidy::IncludeInserter::~IncludeInserter()' clang-3.8: error: linker command failed with exit code 1 (use -v to see invocation) >> >> > ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: r243851 - Fix invalid shufflevector operands
> On 14 Aug 2015, at 19:10, Hans Wennborg wrote: > > On Fri, Aug 14, 2015 at 2:09 AM, John McCall wrote: >>> On Aug 10, 2015, at 12:40 PM, Hans Wennborg wrote: >>> On Fri, Aug 7, 2015 at 11:57 AM, Simon Pilgrim >>> wrote: On 06/08/2015 18:05, Hans Wennborg wrote: > > On Sun, Aug 2, 2015 at 8:28 AM, Simon Pilgrim > wrote: >> >> Author: rksimon >> Date: Sun Aug 2 10:28:10 2015 >> New Revision: 243851 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=243851&view=rev >> Log: >> Fix invalid shufflevector operands >> >> This patch fixes bug 23800 ( >> https://llvm.org/bugs/show_bug.cgi?id=23800#c2 ). There existed a case >> where >> the index operand from extractelement was directly used to create a >> shufflevector mask. Since the index can be of any integral type but the >> mask >> must only contain 32 bit integers a 64 bit index operand led to an >> assertion >> error later on. >> >> Committed on behalf of mpflanzer (Moritz Pflanzer) >> >> Differential Revision: http://reviews.llvm.org/D10838 > > Is this something we should merge to 3.7? It is an edge case and not a regression - at best it would be a 'nice to have'. But it would be a very straightforward merge. >>> >>> John, what do you think? Should we merge this to 3.7? >> >> Seems reasonable. I’m comfortable with small patches that fix crashes. > > Thanks! r245077. Thanks Hans. ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12047: test/SemaObjC: Remove cruft in unused getter test
modocache added a comment. > Why do you think it's a cruft? Seems it's a bit more verbose than it should be The verbosity is the cruft, in my opinion. Why spend thirty lines of code to demonstrate behavior that could be demonstrated in just five? > but what is missing in your test is inheritance, which is important. Is it, though? I haven't read the source code completely, but there doesn't seem to be anything in there written specifically to handle inheritence as deep as the test had it. I believe the relevant code is in `Expr::isUnusedResultAWarning()`, which has case statements for `case ObjCMessageExprClass` and `case ObjCPropertyRefExprClass`. The behavior doesn't change based on where those are defined, whether on a base class or, as in this change, on a protocol. > I think the code for the initial test was just extracted from a real project. Yep, based on the header prefix `XC` I'm guessing it was something in Xcode. And while I appreciate the fact that it's a "real-world" example, I think it's valuable to reduce this sort of thing to the minimum amount of code necessary to demonstrate the behavior. http://reviews.llvm.org/D12047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11772: [libclang] Add period to typedef kind docblock
modocache added a comment. Cool, thanks @compnerd! http://reviews.llvm.org/D11772 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D12047: test/SemaObjC: Remove cruft in unused getter test
AlexDenisov added a comment. s/which is important/which is might be important'/ ;) IMHO, the purpose of the test is not just prove that functionality is working as expected, but also prevent from regression, I completely agree that this test can be cleaned up a bit, but I'd cover at least two cases: a property of a class itself and a property of a superclass. Though, it's better to ask somebody with a proper understanding of internals :) http://reviews.llvm.org/D12047 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
r245162 - [Sema] Be consistent about diagnostic wording: always use "cannot".
Author: davide Date: Sat Aug 15 10:23:14 2015 New Revision: 245162 URL: http://llvm.org/viewvc/llvm-project?rev=245162&view=rev Log: [Sema] Be consistent about diagnostic wording: always use "cannot". Discussed with Richard Smith. Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td cfe/trunk/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp cfe/trunk/test/CXX/over/over.over/p2-resolve-single-template-id.cpp cfe/trunk/test/Sema/ext_vector_casts.c cfe/trunk/test/Sema/zvector.c cfe/trunk/test/SemaCXX/default-assignment-operator.cpp cfe/trunk/test/SemaCXX/vector-casts.cpp cfe/trunk/test/SemaCXX/vector-no-lax.cpp cfe/trunk/test/SemaObjC/arc.m cfe/trunk/test/SemaObjCXX/exceptions.mm cfe/trunk/test/SemaOpenCL/cond.cl cfe/trunk/test/SemaTemplate/deduction.cpp cfe/trunk/test/SemaTemplate/derived.cpp Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=245162&r1=245161&r2=245162&view=diff == --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original) +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Sat Aug 15 10:23:14 2015 @@ -2083,9 +2083,9 @@ def err_attribute_invalid_size : Error< def err_attribute_zero_size : Error<"zero vector size">; def err_attribute_size_too_large : Error<"vector size too large">; def err_typecheck_vector_not_convertable : Error< - "can't convert between vector values of different size (%0 and %1)">; + "cannot convert between vector values of different size (%0 and %1)">; def err_typecheck_vector_not_convertable_non_scalar : Error< - "can't convert between vector and non-scalar values (%0 and %1)">; + "cannot convert between vector and non-scalar values (%0 and %1)">; def err_typecheck_vector_lengths_not_equal : Error< "vector operands do not have the same number of elements (%0 and %1)">; def err_ext_vector_component_exceeds_length : Error< @@ -2888,7 +2888,7 @@ def err_param_default_argument_on_parame "parameter pack cannot have a default argument">; def err_uninitialized_member_for_assign : Error< "cannot define the implicit copy assignment operator for %0, because " - "non-static %select{reference|const}1 member %2 can't use copy " + "non-static %select{reference|const}1 member %2 cannot use copy " "assignment operator">; def err_uninitialized_member_in_ctor : Error< "%select{|implicit default |inheriting }0constructor for %1 must explicitly " @@ -2972,7 +2972,7 @@ def note_ovl_candidate_instantiation_dep "candidate template ignored: substitution exceeded maximum template " "instantiation depth">; def note_ovl_candidate_underqualified : Note< -"candidate template ignored: can't deduce a type for %0 that would " +"candidate template ignored: cannot deduce a type for %0 that would " "make %2 equal %1">; def note_ovl_candidate_substitution_failure : Note< "candidate template ignored: substitution failure%0%1">; @@ -3262,7 +3262,7 @@ def err_addr_ovl_ambiguous : Error< def err_addr_ovl_not_func_ptrref : Error< "address of overloaded function %0 cannot be converted to type %1">; def err_addr_ovl_no_qualifier : Error< - "can't form member pointer of type %0 without '&' and class name">; + "cannot form member pointer of type %0 without '&' and class name">; // C++11 Literal Operators def err_ovl_no_viable_literal_operator : Error< @@ -4556,7 +4556,7 @@ def err_typecheck_arc_assign_self : Erro def err_typecheck_arc_assign_self_class_method : Error< "cannot assign to 'self' in a class method">; def err_typecheck_arr_assign_enumeration : Error< - "fast enumeration variables can't be modified in ARC by default; " + "fast enumeration variables cannot be modified in ARC by default; " "declare the variable __strong to allow this">; def warn_arc_retained_assign : Warning< "assigning retained object to %select{weak|unsafe_unretained}0 " @@ -5370,7 +5370,7 @@ def warn_objc_pointer_cxx_catch_fragile "cannot catch an exception thrown with @throw in C++ in the non-unified " "exception model">, InGroup; def err_objc_object_catch : Error< - "can't catch an Objective-C object by value">; + "cannot catch an Objective-C object by value">; def err_incomplete_type_objc_at_encode : Error< "'@encode' of incomplete type %0">; def warn_objc_circular_container : Warning< Modified: cfe/trunk/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp?rev=245162&r1=245161&r2=245162&view=diff == --- cfe/trunk/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp (original) +++ cfe/trunk/test/CXX/expr/expr.unary/expr.unary.op/p4.cpp Sat Aug 15 10:23:14 2015 @@ -7,7 +7,7 @@ namespace test0 { template void g(T);
[PATCH] D12052: [X86][SSE] Add _mm_undefined_* intrinsics
RKSimon created this revision. RKSimon added reviewers: craig.topper, echristo, mkuper. RKSimon added a subscriber: cfe-commits. RKSimon set the repository for this revision to rL LLVM. Adds missing SSE/AVX 'undefined' intrinsics (PR24040): _mm_undefined_pd + _mm256_undefined_pd _mm_undefined_ps + _mm256_undefined_ps _mm_undefined_si128 + _mm256_undefined_si256 Repository: rL LLVM http://reviews.llvm.org/D12052 Files: lib/Headers/avxintrin.h lib/Headers/emmintrin.h lib/Headers/xmmintrin.h test/CodeGen/sse-undefined.c Index: test/CodeGen/sse-undefined.c === --- test/CodeGen/sse-undefined.c +++ test/CodeGen/sse-undefined.c @@ -0,0 +1,31 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -o - | not grep "xmm" +// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -o - | not grep "ymm" + +// Don't include mm_malloc.h, it's system specific. +#define __MM_MALLOC_H + +#include + +__m128 test_mm_undefined_ps() { + return _mm_undefined_ps(); +} + +__m128d test_mm_undefined_pd() { + return _mm_undefined_pd(); +} + +__m128i test_mm_undefined_si128() { + return _mm_undefined_si128(); +} + +__m256 test_mm256_undefined_ps() { + return _mm256_undefined_ps(); +} + +__m256d test_mm256_undefined_pd() { + return _mm256_undefined_pd(); +} + +__m256i test_mm256_undefined_si256() { + return _mm256_undefined_si256(); +} Index: lib/Headers/xmmintrin.h === --- lib/Headers/xmmintrin.h +++ lib/Headers/xmmintrin.h @@ -577,6 +577,13 @@ } static __inline__ __m128 __DEFAULT_FN_ATTRS +_mm_undefined_ps() +{ + __m128 __u; + return __builtin_shufflevector(__u, __u, -1, -1, -1, -1); +} + +static __inline__ __m128 __DEFAULT_FN_ATTRS _mm_set_ss(float __w) { return (__m128){ __w, 0, 0, 0 }; Index: lib/Headers/emmintrin.h === --- lib/Headers/emmintrin.h +++ lib/Headers/emmintrin.h @@ -523,6 +523,13 @@ } static __inline__ __m128d __DEFAULT_FN_ATTRS +_mm_undefined_pd() +{ + __m128d __u; + return __builtin_shufflevector(__u, __u, -1, -1); +} + +static __inline__ __m128d __DEFAULT_FN_ATTRS _mm_set_sd(double __w) { return (__m128d){ __w, 0 }; @@ -1116,6 +1123,13 @@ } static __inline__ __m128i __DEFAULT_FN_ATTRS +_mm_undefined_si128() +{ + __m128i __u; + return __builtin_shufflevector(__u, __u, -1, -1); +} + +static __inline__ __m128i __DEFAULT_FN_ATTRS _mm_set_epi64x(long long q1, long long q0) { return (__m128i){ q0, q1 }; Index: lib/Headers/avxintrin.h === --- lib/Headers/avxintrin.h +++ lib/Headers/avxintrin.h @@ -900,6 +900,27 @@ } /* Create vectors */ +static __inline__ __m256d __DEFAULT_FN_ATTRS +_mm256_undefined_pd() +{ + __m256d __u; + return __builtin_shufflevector(__u, __u, -1, -1, -1, -1); +} + +static __inline__ __m256 __DEFAULT_FN_ATTRS +_mm256_undefined_ps() +{ + __m256 __u; + return __builtin_shufflevector(__u, __u, -1, -1, -1, -1, -1, -1, -1, -1); +} + +static __inline__ __m256i __DEFAULT_FN_ATTRS +_mm256_undefined_si256() +{ + __m256i __u; + return __builtin_shufflevector(__u, __u, -1, -1, -1, -1); +} + static __inline __m256d __DEFAULT_FN_ATTRS _mm256_set_pd(double __a, double __b, double __c, double __d) { ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D10431: PR21174 - clang only searches current working directory for precompiled include file
kimgr added inline comments. Comment at: lib/Driver/Tools.cpp:398 @@ +397,3 @@ + FoundPTH = !UsePCH; +} + } kimgr wrote: > kimgr wrote: > > kimgr wrote: > > > Add a `break;` here so we don't continue searching after a valid path has > > > been found > > The GCC docs here [1] say: > > > > If not found there, it is searched for in the remainder of the #include > > "..." search chain as normal. > > > > I can't tell if the quotes are significant and if they mean only -I is > > searched. I don't have a GCC environment currently to test with. > > > > [1] > > https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gcc/Preprocessor-Options.html#index-nostdinc_002b_002b-1026 > I found a FreeBSD machine and set up GCC. I had to adjust the repro case to > use `truss` instead of `strace`, so I hope I didn't mess anything up. > > I removed the rule generating the .gch file, so GCC would have to keep > searching and it appears to be following the entire include search path, > including system paths. Trace below: > > ... > 30860: stat("./precompiled.header.gch",0x7fffe540) ERR#2 'No such file or > directory' > 30860: open("./precompiled.header",O_NOCTTY,0666) ERR#2 'No such file or > directory' > 30860: stat("./build/include/precompiled.header.gch",0x7fffe540) ERR#2 > 'No such file or directory' > 30860: open("./build/include/precompiled.header",O_NOCTTY,0666) ERR#2 'No > such file or directory' > 30860: stat("./include/precompiled.header.gch",0x7fffe540) ERR#2 'No such > file or directory' > 30860: open("./include/precompiled.header",O_NOCTTY,0666) ERR#2 'No such file > or directory' > 30860: lstat("/usr",{ mode=drwxr-xr-x ,inode=9,size=16,blksize=4096 }) = 0 > (0x0) > 30860: lstat("/usr/local",{ mode=drwxr-xr-x ,inode=115,size=16,blksize=4096 > }) = 0 (0x0) > 30860: lstat("/usr/local/lib",{ mode=drwxr-xr-x > ,inode=16476,size=1318,blksize=84480 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48",{ mode=drwxr-xr-x > ,inode=24335,size=66,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include",{ mode=drwxr-xr-x > ,inode=24336,size=3,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include/c++",{ mode=drwxr-xr-x > ,inode=24337,size=98,blksize=131072 }) = 0 (0x0) > 30860: > lstat("/usr/local/lib/gcc48/include/c++/precompiled.header",0x7fffd3d8) > ERR#2 'No such file or directory' > 30860: > stat("/usr/local/lib/gcc48/include/c++/precompiled.header.gch",0x7fffe540) > ERR#2 'No such file or directory' > 30860: > open("/usr/local/lib/gcc48/include/c++/precompiled.header",O_NOCTTY,0666) > ERR#2 'No such file or directory' > 30860: lstat("/usr",{ mode=drwxr-xr-x ,inode=9,size=16,blksize=4096 }) = 0 > (0x0) > 30860: lstat("/usr/local",{ mode=drwxr-xr-x ,inode=115,size=16,blksize=4096 > }) = 0 (0x0) > 30860: lstat("/usr/local/lib",{ mode=drwxr-xr-x > ,inode=16476,size=1318,blksize=84480 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48",{ mode=drwxr-xr-x > ,inode=24335,size=66,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include",{ mode=drwxr-xr-x > ,inode=24336,size=3,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include/c++",{ mode=drwxr-xr-x > ,inode=24337,size=98,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include/c++/x86_64-portbld-freebsd10.1",{ > mode=drwxr-xr-x ,inode=21305,size=4,blksize=131072 }) = 0 (0x0) > 30860: > lstat("/usr/local/lib/gcc48/include/c++/x86_64-portbld-freebsd10.1/precompiled.header",0x7fffd3d8) > ERR#2 'No such file or directory' > 30860: > stat("/usr/local/lib/gcc48/include/c++//x86_64-portbld-freebsd10.1/precompiled.header.gch",0x7fffe540) > ERR#2 'No such file or directory' > 30860: > open("/usr/local/lib/gcc48/include/c++//x86_64-portbld-freebsd10.1/precompiled.header",O_NOCTTY,0666) > ERR#2 'No such file or directory' > 30860: lstat("/usr",{ mode=drwxr-xr-x ,inode=9,size=16,blksize=4096 }) = 0 > (0x0) > 30860: lstat("/usr/local",{ mode=drwxr-xr-x ,inode=115,size=16,blksize=4096 > }) = 0 (0x0) > 30860: lstat("/usr/local/lib",{ mode=drwxr-xr-x > ,inode=16476,size=1318,blksize=84480 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48",{ mode=drwxr-xr-x > ,inode=24335,size=66,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include",{ mode=drwxr-xr-x > ,inode=24336,size=3,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include/c++",{ mode=drwxr-xr-x > ,inode=24337,size=98,blksize=131072 }) = 0 (0x0) > 30860: lstat("/usr/local/lib/gcc48/include/c++/backward",{ mode=drwxr-xr-x > ,inode=21290,size=10,blksize=131072 }) = 0 (0x0) > 30860: > lstat("/usr/local/lib/gcc48/include/c++/backward/precompiled.header",0x7fffd3d8) > ERR#2 'No such file or directory' > 30860: > stat("/usr/local/lib/gcc48/include/c++//backward/precompiled.header.gch",0x7fffe540) > ERR#2 'No such file or directory' > 30860: > open("/usr/local/lib/gcc48/include/c++//ba
Re: [PATCH] D11932: [OPENMP] Link libomp.lib on Windows
hfinkel added a subscriber: hfinkel. hfinkel added a comment. In http://reviews.llvm.org/D11932#222515, @ismail wrote: > Tests pass but, now when I tried to compile a file with -fopenmp I get: > > LINK: fatal error LNK1104: cannot open file 'libomp.lib' > > libomp.lib does exist in "C:\Program Files\LLVM\lib" but I guess we need to > pass the library path down to linker. What library path should be passed (where did you build the OpenMP runtime library)? http://reviews.llvm.org/D11932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Re: [PATCH] D11789: Modify DeclaratorChuck::getFunction to be passed an Exception Specification SourceRange
nwilson updated this revision to Diff 32228. nwilson added a comment. Patch addressing comments; fix comment/documentation wording, scoping of diagnostic and setting invalid declaration, and fix test. I also modified the location of the diagnostic indicating an exception specification is not allowed to point to the function declarator in order to handle a range having an invalid begin location. The 80 column limit was overrun in SemaType.cpp, so clang format has been run on the problematic lines in the file. http://reviews.llvm.org/D11789 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Sema/DeclSpec.h lib/Parse/ParseDecl.cpp lib/Parse/ParseExpr.cpp lib/Parse/ParseExprCXX.cpp lib/Sema/DeclSpec.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaType.cpp test/SemaCXX/cxx-concept-declaration.cpp Index: test/SemaCXX/cxx-concept-declaration.cpp === --- test/SemaCXX/cxx-concept-declaration.cpp +++ test/SemaCXX/cxx-concept-declaration.cpp @@ -1,11 +1,14 @@ -// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -x c++ -verify %s +// RUN: %clang_cc1 -std=c++14 -fconcepts-ts -fcxx-exceptions -x c++ -verify %s namespace A { template concept bool C1() { return true; } template concept bool C2 = true; } +template concept bool C3() { return (throw 0, true); } +static_assert(noexcept(C3()), "function concept should be treated as if noexcept(true) specified"); + template concept bool D1(); // expected-error {{function concept declaration must be a definition}} struct B { @@ -23,6 +26,9 @@ template concept bool D6; // expected-error {{variable concept declaration must be initialized}} +template +concept bool D7() throw(int) { return true; } // expected-error {{function concept cannot have exception specification}} + // Tag concept class CC1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}} concept struct CS1 {}; // expected-error {{'concept' can only appear on the definition of a function template or variable template}} Index: lib/Sema/SemaType.cpp === --- lib/Sema/SemaType.cpp +++ lib/Sema/SemaType.cpp @@ -700,7 +700,7 @@ /*VolatileQualifierLoc=*/NoLoc, /*RestrictQualifierLoc=*/NoLoc, /*MutableLoc=*/NoLoc, EST_None, - /*ESpecLoc=*/NoLoc, + /*ESpecRange=*/SourceRange(), /*Exceptions=*/nullptr, /*ExceptionRanges=*/nullptr, /*NumExceptions=*/0, @@ -3833,9 +3833,10 @@ // Exception specs are not allowed in typedefs. Complain, but add it // anyway. if (IsTypedefName && FTI.getExceptionSpecType()) -S.Diag(FTI.getExceptionSpecLoc(), diag::err_exception_spec_in_typedef) - << (D.getContext() == Declarator::AliasDeclContext || - D.getContext() == Declarator::AliasTemplateContext); +S.Diag(FTI.getExceptionSpecLocBeg(), + diag::err_exception_spec_in_typedef) +<< (D.getContext() == Declarator::AliasDeclContext || +D.getContext() == Declarator::AliasTemplateContext); // If we see "T var();" or "T var(T());" at block scope, it is probably // an attempt to initialize a variable, not a function declaration. Index: lib/Sema/SemaDecl.cpp === --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -7466,6 +7466,22 @@ NewFD->setInvalidDecl(); } + // C++ Concepts TS [dcl.spec.concept]p1: [...] A function concept shall + // have no exception-specification and is treated as if it were specified + // with noexcept(true) (15.4). [...] + if (const FunctionProtoType *FPT = R->getAs()) { +if (FPT->hasExceptionSpec()) { + SourceRange Range; + if (D.isFunctionDeclarator()) +Range = D.getFunctionTypeInfo().getExceptionSpecRange(); + Diag(NewFD->getLocation(), diag::err_function_concept_exception_spec) + << FixItHint::CreateRemoval(Range); + NewFD->setInvalidDecl(); +} else { + Context.adjustExceptionSpec(NewFD, EST_BasicNoexcept); +} + } + // C++ Concepts TS [dcl.spec.concept]p2: Every concept definition is // implicity defined to be a constexpr declaration (implicitly inline) NewFD->setImplicitlyInline(); @@ -11099,7 +5,7 @@ /*RestrictQualifierLoc=*/NoLoc, /*MutableLoc=*/NoLoc, EST_None, - /*ESpecLoc=*/NoLoc, + /*ESpecRange=*/SourceRange(), /*Exceptions=*/nullptr, /*ExceptionRanges=*/nullptr,
Re: [PATCH] D11932: [OPENMP] Link libomp.lib on Windows
ismail added a comment. In http://reviews.llvm.org/D11932#225158, @hfinkel wrote: > What library path should be passed (where did you build the OpenMP runtime > library)? This is a default installation so the lib path is $PATH_TO_CLANG_EXE/../lib which in my case is C:\Program Files\LLVM\lib http://reviews.llvm.org/D11932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits