r283771 - Use unique_ptr for VTableBuilder::VFTableLayouts map.

2016-10-10 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Oct 10 11:26:33 2016 New Revision: 283771 URL: http://llvm.org/viewvc/llvm-project?rev=283771=rev Log: Use unique_ptr for VTableBuilder::VFTableLayouts map. Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25423 Modified:

r283768 - [AST] Convert MangleNumberingContext to a unique_ptr.

2016-10-10 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Oct 10 11:26:19 2016 New Revision: 283768 URL: http://llvm.org/viewvc/llvm-project?rev=283768=rev Log: [AST] Convert MangleNumberingContext to a unique_ptr. Summary: It doesn't need to be refcounted anymore, either. Reviewers: timshen Subscribers: cfe-commits

r283766 - [Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.

2016-10-10 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Oct 10 11:26:08 2016 New Revision: 283766 URL: http://llvm.org/viewvc/llvm-project?rev=283766=rev Log: [Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map. Summary: This is possible now that MapVector supports move-only values. Depends on

[PATCH] D25419: Use unique_ptr in LLVMContextImpl's constant maps.

2016-10-10 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: llvm/lib/IR/LLVMContextImpl.cpp:106 for (auto : CDSConstants) delete CDSConstant.second; CDSConstants.clear(); jlebar wrote: > timshen wrote: > > Do you want to change this one as well? > Sure, but this one

[PATCH] D25419: Use unique_ptr in LLVMContextImpl's constant maps.

2016-10-10 Thread Justin Lebar via cfe-commits
jlebar marked an inline comment as done. jlebar added inline comments. Comment at: llvm/lib/IR/LLVMContextImpl.cpp:106 for (auto : CDSConstants) delete CDSConstant.second; CDSConstants.clear(); timshen wrote: > Do you want to change this one as well?

Re: r283680 - [CUDA] Support and std::min/max on the device.

2016-10-10 Thread Justin Lebar via cfe-commits
wrote: > This broke bootstrap builds, I reverted it for now in r283747. > > On Sat, Oct 8, 2016 at 6:16 PM, Justin Lebar via cfe-commits > <cfe-commits@lists.llvm.org> wrote: >> >> Author: jlebar >> Date: Sat Oct 8 17:16:12 2016 >> New Revision: 283680 &g

[PATCH] D25427: [Analysis] Use unique_ptr for CallGraph::FunctionMap.

2016-10-10 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. The decltype(declval) dance in the iterator traits is necessary because DenseMap iterators aren't over std::pairs, but rather are over a pair-like type defined in DenseMap. It used to work

[PATCH] D25426: [Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25426 Files: clang/include/clang/Analysis/AnalysisContext.h clang/lib/Analysis/AnalysisDeclContext.cpp Index: clang/lib/Analysis/AnalysisDeclContext.cpp

[PATCH] D25425: [AST] Convert Marshallers to use unique_ptr.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. Herald added a subscriber: klimek. https://reviews.llvm.org/D25425 Files: clang/lib/ASTMatchers/Dynamic/Marshallers.h clang/lib/ASTMatchers/Dynamic/Registry.cpp Index:

[PATCH] D25424: Use unique_ptr for VTableBuilder::VBaseInfo map.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25424 Files: clang/include/clang/AST/VTableBuilder.h clang/lib/AST/VTableBuilder.cpp Index: clang/lib/AST/VTableBuilder.cpp

[PATCH] D25423: Use unique_ptr for VTableBuilder::VFTableLayouts map.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25423 Files: clang/include/clang/AST/VTableBuilder.h clang/lib/AST/VTableBuilder.cpp Index: clang/lib/AST/VTableBuilder.cpp

[PATCH] D25422: Use unique_ptr for VPtrLocationsMap and VPtrInfoVector.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25422 Files: clang/include/clang/AST/VTableBuilder.h clang/lib/AST/VTableBuilder.cpp clang/lib/CodeGen/MicrosoftCXXABI.cpp Index:

[PATCH] D25421: [AST] Use unique_ptr for VTableLayout.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25421 Files: clang/include/clang/AST/VTableBuilder.h clang/lib/AST/VTableBuilder.cpp Index: clang/lib/AST/VTableBuilder.cpp

[PATCH] D25420: [AST] Convert MangleNumberingContext to a unique_ptr.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. It doesn't need to be refcounted anymore, either. https://reviews.llvm.org/D25420 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/MangleNumberingContext.h

[PATCH] D25419: Use unique_ptr in LLVMContextImpl's constant maps.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25419 Files: llvm/lib/IR/Constants.cpp llvm/lib/IR/LLVMContextImpl.cpp llvm/lib/IR/LLVMContextImpl.h Index: llvm/lib/IR/LLVMContextImpl.h

[PATCH] D25405: [Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: timshen. jlebar added a subscriber: cfe-commits. jlebar added a dependency: D25404: [ADT] Let MapVector handle non-copyable values.. This is possible now that MapVector supports move-only values. Depends on https://reviews.llvm.org/D25404.

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar added a comment. Although these pass the CUDA test-suite tests (which I haven't yet committed because they're broken without this change), I could use some help running the libcxx tests. I cannot find any documentation explaining how to run the libcxx tests with just-built clang.

Re: r283680 - [CUDA] Support and std::min/max on the device.

2016-10-09 Thread Justin Lebar via cfe-commits
t; -ffast-math >>> -ffinite-math-only. GCC can do it. Clang gets std::isnan. >>> https://godbolt.org/g/vZB55a >>> >>> By the way, the changes you made to libc++ unfortunately break this >>> patch with libc++, because e.g. __libcpp_isnan is not a device

[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

2016-10-09 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: hfinkel. jlebar added a subscriber: cfe-commits. This makes these functions available on host and device, which is necessary to compile for the device. https://reviews.llvm.org/D25403 Files: libcxx/include/cmath Index:

Re: r283680 - [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
tps://reviews.llvm.org/D24300 >> >> On Sat, Oct 8, 2016 at 3:36 PM, Hal Finkel <hfin...@anl.gov> wrote: >> > Hi Justin, >> > >> > This is neat! >> > >> > I see a bunch of uses of std::isinf, etc. here. It tends to be >> > important t

r283683 - [CUDA] Don't install cuda_wrappers/{algorithm, complex} into the main include dir.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 19:27:39 2016 New Revision: 283683 URL: http://llvm.org/viewvc/llvm-project?rev=283683=rev Log: [CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include dir. This is obviously wrong -- if we do this, then all compiles will pick up these

Re: r283680 - [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
> optimized away. Can you please check that they do? If not, you might mirror > what I've done in r283051 for libc++, which is similar to what libstdc++ ends > up doing, so that we use __builtin_isnan/isinf/isfinite. > > Thanks again, > Hal > > ----- Original Message

[PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283680: [CUDA] Support and std::min/max on the device. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24979?vs=72719=74053#toc Repository: rL LLVM

r283680 - [CUDA] Support and std::min/max on the device.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 17:16:12 2016 New Revision: 283680 URL: http://llvm.org/viewvc/llvm-project?rev=283680=rev Log: [CUDA] Support and std::min/max on the device. Summary: We do this by wrapping and . Tests are in the test-suite. Reviewers: tra Subscribers: jhen, beanz,

[PATCH] D24978: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283679: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24978?vs=72685=74054#toc Repository: rL LLVM

r283679 - [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 17:16:08 2016 New Revision: 283679 URL: http://llvm.org/viewvc/llvm-project?rev=283679=rev Log: [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h. Summary: This matches the idiom we use for our other CUDA wrapper headers. Reviewers: tra

r283677 - [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-10-08 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sat Oct 8 17:15:58 2016 New Revision: 283677 URL: http://llvm.org/viewvc/llvm-project?rev=283677=rev Log: [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas. Summary: These cause us to consider all functions in-between to be __host__ __device__. You can

[PATCH] D24977: [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283678: [CUDA] Declare our __device__ math functions in the same inline namespace as… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24977?vs=72684=74052#toc Repository: rL

[PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283677: [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24975?vs=72734=74051#toc Repository: rL LLVM

[PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-10-08 Thread Justin Lebar via cfe-commits
jlebar marked 2 inline comments as done. jlebar added a comment. In https://reviews.llvm.org/D24975#565054, @rsmith wrote: > Please add a test to test/PCH for the serialization code. Otherwise, LGTM. Test added. It caught a bug, too. :) Thank you for the review.

[PATCH] D24573: [CUDA] Do a better job at detecting wrong-side calls.

2016-10-08 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283637: [CUDA] Do a better job at detecting wrong-side calls. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24573?vs=71381=74030#toc Repository: rL LLVM

r283637 - [CUDA] Do a better job at detecting wrong-side calls.

2016-10-07 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Oct 7 20:07:11 2016 New Revision: 283637 URL: http://llvm.org/viewvc/llvm-project?rev=283637=rev Log: [CUDA] Do a better job at detecting wrong-side calls. Summary: Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to DiagnoseUseOfDecl. This lets us catch some

r283487 - [Sema] Replace smart quote with "'" in comment.

2016-10-06 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu Oct 6 14:47:56 2016 New Revision: 283487 URL: http://llvm.org/viewvc/llvm-project?rev=283487=rev Log: [Sema] Replace smart quote with "'" in comment. Looks like the smart quote was copy/pasted from the C++ standard. The smart quote was not encoded as valid UTF-8 (?),

r283280 - [CUDA] Add missing ':' to noexcept.cu test.

2016-10-04 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Oct 4 19:27:38 2016 New Revision: 283280 URL: http://llvm.org/viewvc/llvm-project?rev=283280=rev Log: [CUDA] Add missing ':' to noexcept.cu test. Modified: cfe/trunk/test/CodeGenCUDA/nothrow.cu Modified: cfe/trunk/test/CodeGenCUDA/nothrow.cu URL:

r283272 - [CUDA] Mark device functions as nounwind.

2016-10-04 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Oct 4 18:41:49 2016 New Revision: 283272 URL: http://llvm.org/viewvc/llvm-project?rev=283272=rev Log: [CUDA] Mark device functions as nounwind. Summary: This prevents clang from emitting 'invoke's and catch statements. Things previously mostly worked thanks to

[PATCH] D25260: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

2016-10-04 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283271: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25260?vs=73578=73580#toc Repository: rL LLVM

r283271 - [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

2016-10-04 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Tue Oct 4 18:41:45 2016 New Revision: 283271 URL: http://llvm.org/viewvc/llvm-project?rev=283271=rev Log: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator. Summary: This will let us (in a separate patch) allocate deferred

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73579. jlebar marked an inline comment as done. jlebar added a comment. Update tests. https://reviews.llvm.org/D25166 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGException.cpp clang/test/CodeGenCUDA/convergent.cu

[PATCH] D25260: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73578. jlebar added a comment. Update comment. https://reviews.llvm.org/D25260 Files: clang/include/clang/AST/ASTContext.h clang/lib/CodeGen/CodeGenModule.cpp Index: clang/lib/CodeGen/CodeGenModule.cpp

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73577. jlebar added a comment. Move everything into codegen. https://reviews.llvm.org/D25166 Files: clang/lib/CodeGen/CGCall.cpp clang/lib/CodeGen/CGException.cpp clang/test/CodeGenCUDA/convergent.cu clang/test/CodeGenCUDA/device-var-init.cu

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73576. jlebar marked an inline comment as done. jlebar added a comment. Rebase atop https://reviews.llvm.org/D25260, which obviates the need for this ugly PD allocation dance. https://reviews.llvm.org/D25139 Files:

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-04 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in Sema.h:9258 > The ASTContext should outlive IRgen, since the AST is allocated in its arena. > Is there a separate diagnostic memory pool that I don't know about? You're right, this is a silly bug. Fixed in a separate patch,

[PATCH] D24571: [CUDA] Disallow overloading destructors.

2016-10-04 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL283120: [CUDA] Disallow overloading destructors. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D24571?vs=71379=73413#toc Repository: rL LLVM

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in Sema.h:9238 > I'm concerned that this usage pattern isn't going to be efficient because you > build the complete diagnostic before calling the bool conversion operator to > determine that it doesn't need to be emitted. I think you want to construct

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73315. jlebar marked an inline comment as done. jlebar added a comment. Address review comments, and rebase atop https://reviews.llvm.org/D24573. https://reviews.llvm.org/D25139 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

r283120 - [CUDA] Disallow overloading destructors.

2016-10-03 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Oct 3 11:48:23 2016 New Revision: 283120 URL: http://llvm.org/viewvc/llvm-project?rev=283120=rev Log: [CUDA] Disallow overloading destructors. Summary: We'd attempted to allow this, but turns out we were doing a very bad job. :) Making this work properly would be a

r283121 - [CUDA] Clean up some comments in Sema::IsOverload. NFC

2016-10-03 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Mon Oct 3 11:48:27 2016 New Revision: 283121 URL: http://llvm.org/viewvc/llvm-project?rev=283121=rev Log: [CUDA] Clean up some comments in Sema::IsOverload. NFC Modified: cfe/trunk/lib/Sema/SemaOverload.cpp Modified: cfe/trunk/lib/Sema/SemaOverload.cpp URL:

[PATCH] D24571: [CUDA] Disallow overloading destructors.

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in SemaOverload.cpp:1131 > I feel like we should exit early on destructors here, before we do any target > checks. The assert also feels kind of trivial because we only come into this > overload machinery if looking up New's DeclarationName found Old.

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-03 Thread Justin Lebar via cfe-commits
jlebar added a comment. In https://reviews.llvm.org/D25166#559117, @rnk wrote: > It feels like the right thing is to disable EH in device side compilation, > but obviously that won't work because it would reject try/throw in host code. Exactly. > I think instead of doing that, we should make

[PATCH] D25166: [CUDA] Mark device functions as nounwind.

2016-10-02 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added a subscriber: cfe-commits. This prevents clang from emitting 'invoke's and catch statements. Things previously mostly worked thanks to TryToMarkNoThrow() in CodeGenFunction. But this is not a proper IPO, and it doesn't

r283068 - [CUDA] Allow extern __shared__ on empty-length arrays.

2016-10-02 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Sun Oct 2 10:24:50 2016 New Revision: 283068 URL: http://llvm.org/viewvc/llvm-project?rev=283068=rev Log: [CUDA] Allow extern __shared__ on empty-length arrays. "extern __shared__ int x[]" is OK. Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp

[PATCH] D25150: [CUDA] Allow static variables in __host__ __device__ functions, so long as they're never codegen'ed for device.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added reviewers: tra, rnk. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25150 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDecl.cpp clang/test/SemaCUDA/device-var-init.cu

[PATCH] D25143: [CUDA] Disallow __shared__ variables in host functions.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73172. jlebar added a comment. Update to new CUDADiagIfHostCode API. https://reviews.llvm.org/D25143 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu Index:

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73171. jlebar added a comment. Tweak API a bit. Now we rely on an implicit conversion to bool. Which is not great, I know, but in practice I think works better than an explicit named function. https://reviews.llvm.org/D25139 Files:

r282986 - [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 18:57:34 2016 New Revision: 282986 URL: http://llvm.org/viewvc/llvm-project?rev=282986=rev Log: [CUDA] Disallow __constant__ local variables. Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25129 Modified:

[PATCH] D25125: [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282985: [CUDA] Disallow 'extern __shared__' variables. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25125?vs=73136=73167#toc Repository: rL LLVM

r282987 - [CUDA] Harmonize asserts in SemaCUDA, NFC.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 18:57:38 2016 New Revision: 282987 URL: http://llvm.org/viewvc/llvm-project?rev=282987=rev Log: [CUDA] Harmonize asserts in SemaCUDA, NFC. Modified: cfe/trunk/lib/Sema/SemaCUDA.cpp Modified: cfe/trunk/lib/Sema/SemaCUDA.cpp URL:

r282985 - [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 18:57:30 2016 New Revision: 282985 URL: http://llvm.org/viewvc/llvm-project?rev=282985=rev Log: [CUDA] Disallow 'extern __shared__' variables. Also add a test that we disallow __constant__ __shared__ int x; because it's possible to break this without breaking

[PATCH] D25129: [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > tra wrote in DiagnosticSemaKinds.td:6727 > It's not clear whether you mean global storage class or global namespace. > The code checks for global storage, but error message is could be interpreted > either way, IMO. > > I'll leave phrasing up to you. > It's not

[PATCH] D25143: [CUDA] Disallow __shared__ variables in host functions.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added reviewers: tra, rnk. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25143 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu Index:

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73165. jlebar added a comment. Add CUDADiagIfHostCode(). https://reviews.llvm.org/D25139 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaExprCXX.cpp

[PATCH] D25139: [CUDA] Add Sema::CUDADiagBuilder and Sema::CUDADiagIfDeviceCode().

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. Together these let you easily create diagnostics that - are never emitted for host code - are always emitted for __device__ and __global__ functions, and - are emitted for __host__ __device__

[PATCH] D25129: [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > tra wrote in DiagnosticSemaKinds.td:6727 > Nit: Technically they are allowed in namespace scope. That's still a "global variable"? Or do you think calling it such will be confusing? https://reviews.llvm.org/D25129

[PATCH] D25129: [CUDA] Disallow __constant__ local variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added reviewers: tra, rnk. jlebar added a subscriber: cfe-commits. https://reviews.llvm.org/D25129 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu Index:

[PATCH] D25125: [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73136. jlebar added a comment. Fix typo (and add a test to catch it). https://reviews.llvm.org/D25125 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/bad-attributes.cu

[PATCH] D25125: [CUDA] Disallow 'extern __shared__' variables.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. https://reviews.llvm.org/D25125 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclAttr.cpp clang/test/SemaCUDA/extern-shared.cu Index:

r282927 - [CUDA] Fix implicit-device-lambda.cu after r282911.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 15:17:37 2016 New Revision: 282927 URL: http://llvm.org/viewvc/llvm-project?rev=282927=rev Log: [CUDA] Fix implicit-device-lambda.cu after r282911. This commit added a warning that we're (correctly) hitting in this test. Just ignore it. Modified:

[PATCH] D25114: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282910: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25114?vs=73104=73122#toc Repository:

[PATCH] D25115: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282911: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25115?vs=73105=73123#toc Repository:

r282912 - [CUDA] Remove incorrect comment in CUDASetLambdaAttrs.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 14:55:59 2016 New Revision: 282912 URL: http://llvm.org/viewvc/llvm-project?rev=282912=rev Log: [CUDA] Remove incorrect comment in CUDASetLambdaAttrs. I'd said that nvcc doesn't allow you to add __host__ or __device__ attributes on lambdas in all circumstances,

r282911 - [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 14:55:55 2016 New Revision: 282911 URL: http://llvm.org/viewvc/llvm-project?rev=282911=rev Log: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'. Summary: This is probably the sane place for the attribute to go, but nvcc

r282910 - [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 14:55:48 2016 New Revision: 282910 URL: http://llvm.org/viewvc/llvm-project?rev=282910=rev Log: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas. Summary: There's an overload that we can use to make this a bit cleaner.

[PATCH] D25115: [CUDA] Emit a warning if a CUDA host/device/global attribute is placed after '(...)'.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. This is probably the sane place for the attribute to go, but nvcc specifically rejects it. Other GNU-style attributes are allowed in this position (although judging from the warning it emits

[PATCH] D25114: [CUDA] Fix up MaybeParseGNUAttributes call used for out-of-place attributes on CUDA lambdas.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. There's an overload that we can use to make this a bit cleaner. https://reviews.llvm.org/D25114 Files: clang/lib/Parse/ParseExprCXX.cpp Index: clang/lib/Parse/ParseExprCXX.cpp

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar added inline comments. > rnk wrote in ParseExprCXX.cpp:1135 > Does nvcc support __declspec style attributes? Maybe we should check for > those too? nvcc doesn't seem to support __declspec attributes. I have no strong opinion on whether or not we should add them ourselves, though I

[PATCH] D25105: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282880: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope… (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25105?vs=73073=73089#toc Repository:

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282879: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...). (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25103?vs=73085=73088#toc Repository: rL

r282878 - [CUDA] Add missing comment on Sema::CheckCUDAVLA.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 12:14:44 2016 New Revision: 282878 URL: http://llvm.org/viewvc/llvm-project?rev=282878=rev Log: [CUDA] Add missing comment on Sema::CheckCUDAVLA. Modified: cfe/trunk/include/clang/Sema/Sema.h Modified: cfe/trunk/include/clang/Sema/Sema.h URL:

r282880 - [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 12:14:53 2016 New Revision: 282880 URL: http://llvm.org/viewvc/llvm-project?rev=282880=rev Log: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created. Summary: NVCC compat. Fixes bug 30567. Reviewers: tra

r282879 - [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Fri Sep 30 12:14:48 2016 New Revision: 282879 URL: http://llvm.org/viewvc/llvm-project?rev=282879=rev Log: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...). Summary: This is ugh, but it makes us compatible with NVCC. Fixes bug 26341. Reviewers:

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 73085. jlebar marked an inline comment as done. jlebar added a comment. Don't hallucinate a function declarator. https://reviews.llvm.org/D25103 Files: clang/lib/Parse/ParseExprCXX.cpp clang/test/Parser/lambda-attr.cu Index:

[PATCH] D25105: [CUDA] Make lambdas inherit __host__ and __device__ attributes from the scope in which they're created.

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: rnk, cfe-commits. NVCC compat. Fixes bug 30567. https://reviews.llvm.org/D25105 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaLambda.cpp

[PATCH] D25103: [CUDA] Handle attributes on CUDA lambdas appearing between [...] and (...).

2016-09-30 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: rnk. jlebar added subscribers: tra, cfe-commits. This is ugh, but it makes us compatible with NVCC. Fixes bug 26341. https://reviews.llvm.org/D25103 Files: clang/lib/Parse/ParseExprCXX.cpp clang/test/Parser/lambda-attr.cu Index:

r282822 - Move UTF functions into namespace llvm.

2016-09-29 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Thu Sep 29 19:38:45 2016 New Revision: 282822 URL: http://llvm.org/viewvc/llvm-project?rev=282822=rev Log: Move UTF functions into namespace llvm. Summary: This lets people link against LLVM and their own version of the UTF library. I determined this only affects llvm,

Re: [PATCH] D24573: [CUDA] Do a better job at detecting wrong-side calls.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar added a comment. I'm sorry to put more stuff on your plate, Richard, but you already have context on this, so you may be the best person to review this. Unfortunately people keep hitting the bug fixed here (and being confused), so it's maybe not as much of an edge case as I thought.

Re: [PATCH] D25036: [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. jlebar marked an inline comment as done. Closed by commit rL282646: [CUDA] Disallow exceptions in device code. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25036?vs=72872=72918#toc

r282646 - [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Sep 28 17:45:54 2016 New Revision: 282646 URL: http://llvm.org/viewvc/llvm-project?rev=282646=rev Log: [CUDA] Disallow exceptions in device code. Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D25036 Added:

r282647 - [CUDA] Disallow variable-length arrays in CUDA device code.

2016-09-28 Thread Justin Lebar via cfe-commits
Author: jlebar Date: Wed Sep 28 17:45:58 2016 New Revision: 282647 URL: http://llvm.org/viewvc/llvm-project?rev=282647=rev Log: [CUDA] Disallow variable-length arrays in CUDA device code. Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D25050

Re: [PATCH] D25050: [CUDA] Disallow variable-length arrays in CUDA device code.

2016-09-28 Thread Justin Lebar via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL282647: [CUDA] Disallow variable-length arrays in CUDA device code. (authored by jlebar). Changed prior to commit: https://reviews.llvm.org/D25050?vs=72914=72919#toc Repository: rL LLVM

[PATCH] D25050: [CUDA] Disallow variable-length arrays in CUDA device code.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: jhen, cfe-commits. https://reviews.llvm.org/D25050 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaType.cpp

Re: [PATCH] D25036: [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar marked an inline comment as done. Comment at: clang/lib/Sema/SemaExprCXX.cpp:688 @@ +687,3 @@ + if (getLangOpts().CUDA) +CheckCUDAExceptionExpr(OpLoc, "throw"); + tra wrote: > Do you need/want to check returned result? We could, and we could return

[PATCH] D25036: [CUDA] Disallow exceptions in device code.

2016-09-28 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: jhen, cfe-commits. https://reviews.llvm.org/D25036 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaExprCXX.cpp

Re: [PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added a comment. > What happens if there are trailing tokens after the pragma? Added code to make this an error. https://reviews.llvm.org/D24975 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 72734. jlebar marked 2 inline comments as done. jlebar added a comment. Address Richard's comments. I'm fairly neutral on whether we want to make it an error not to match all of your "begin" pragmas with "end"s. I checked pragma push_macro, and it looks like

Re: [PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 72719. jlebar added a comment. Herald added a subscriber: mehdi_amini. s/libgcc/runtime/ https://reviews.llvm.org/D24979 Files: clang/lib/Driver/ToolChains.cpp clang/lib/Headers/CMakeLists.txt clang/lib/Headers/__clang_cuda_complex_builtins.h

Re: [PATCH] D24975: [CUDA] Add #pragma clang force_cuda_host_device_{begin, end} pragmas.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar updated this revision to Diff 72717. jlebar marked 2 inline comments as done. jlebar added a comment. Address Richard Smith's review comments: - Change macro format. - Add tests (these Just Worked). https://reviews.llvm.org/D24975 Files:

Re: [PATCH] D24946: [CUDA] Added support for CUDA-8

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added inline comments. Comment at: lib/Headers/__clang_cuda_runtime_wrapper.h:139 @@ -137,1 +138,3 @@ +// CUDA 8.0.41 relies on __USE_FAST_MATH__ and __CUDA_PREC_DIV's values +// Previous versions used to check thether they are defined or not. Nit,

Re: [PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added a comment. > I' personally would prefer to force-include these files. I suspect it will > not change things much as we already include a lot. We have already had bugs filed by users whose root cause was that we #included more things than nvcc #includes. I know exact

Re: [PATCH] D24977: [CUDA] Declare our __device__ math functions in the same inline namespace as our standard library.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar added a comment. > That is way too much knowledge about details of standard library > implementation. Honestly I think this looks a lot scarier than it is. Or, to be specific, I think we are already relying on implementation details much more implicit and fragile than what is

[PATCH] D24979: [CUDA] Support and std::min/max on the device.

2016-09-27 Thread Justin Lebar via cfe-commits
jlebar created this revision. jlebar added a reviewer: tra. jlebar added subscribers: cfe-commits, jhen. Herald added subscribers: mgorny, beanz. We do this by wrapping and . Tests are in the test-suite. support to come separately. https://reviews.llvm.org/D24979 Files:

<    1   2   3   4   5   6   7   8   9   >