From 236ec542e5eaf20664ba9cdda99613a848d5110b Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Fri, 30 Sep 2016 23:57:38 +0000 Subject: [PATCH] [CUDA] Harmonize asserts in SemaCUDA, NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@282987 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaCUDA.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Sema/SemaCUDA.cpp b/lib/Sema/SemaCUDA.cpp index abfe107d00..822304195d 100644 --- a/lib/Sema/SemaCUDA.cpp +++ b/lib/Sema/SemaCUDA.cpp @@ -443,7 +443,7 @@ bool Sema::isEmptyCudaDestructor(SourceLocation Loc, CXXDestructorDecl *DD) { // system header, in which case we leave the constexpr function unattributed. void Sema::maybeAddCUDAHostDeviceAttrs(Scope *S, FunctionDecl *NewD, const LookupResult &Previous) { - assert(getLangOpts().CUDA && "May be called only for CUDA compilations."); + assert(getLangOpts().CUDA && "Should only be called during CUDA compilation"); if (!getLangOpts().CUDAHostDeviceConstexpr || !NewD->isConstexpr() || NewD->isVariadic() || NewD->hasAttr() || NewD->hasAttr() || NewD->hasAttr()) @@ -482,8 +482,7 @@ void Sema::maybeAddCUDAHostDeviceAttrs(Scope *S, FunctionDecl *NewD, } bool Sema::CheckCUDACall(SourceLocation Loc, FunctionDecl *Callee) { - assert(getLangOpts().CUDA && - "Should only be called during CUDA compilation."); + assert(getLangOpts().CUDA && "Should only be called during CUDA compilation"); assert(Callee && "Callee may not be null."); FunctionDecl *Caller = dyn_cast(CurContext); if (!Caller) @@ -561,6 +560,7 @@ bool Sema::CheckCUDAVLA(SourceLocation Loc) { } void Sema::CUDASetLambdaAttrs(CXXMethodDecl *Method) { + assert(getLangOpts().CUDA && "Should only be called during CUDA compilation"); if (Method->hasAttr() || Method->hasAttr()) return; FunctionDecl *CurFn = dyn_cast(CurContext); -- 2.50.1