From 25c4a81e79b08c5781a7d0d551d9a21771b01e7b Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Tue, 29 Mar 2016 16:24:16 +0000 Subject: [CUDA] Remove three obsolete CUDA cc1 flags. Summary: * -fcuda-target-overloads Previously unconditionally set to true by the driver. Necessary for correct functioning of the compiler -- our CUDA headers wrapper won't compile without this. * -fcuda-disable-target-call-checks Previously unconditionally set to true by the driver. Necessary to compile almost any external CUDA code -- almost all libraries assume that host+device code can call host or device functions. * -fcuda-allow-host-calls-from-host-device No effect when target overloading is enabled. Reviewers: tra Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D18416 llvm-svn: 264739 --- clang/lib/Sema/SemaDecl.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index c8a9b9ac807..1f03735ef94 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5648,10 +5648,9 @@ static bool isIncompleteDeclExternC(Sema &S, const T *D) { if (!D->isInExternCContext() || D->template hasAttr()) return false; - // So do CUDA's host/device attributes if overloading is enabled. - if (S.getLangOpts().CUDA && S.getLangOpts().CUDATargetOverloads && - (D->template hasAttr() || - D->template hasAttr())) + // So do CUDA's host/device attributes. + if (S.getLangOpts().CUDA && (D->template hasAttr() || + D->template hasAttr())) return false; } return D->isExternC(); @@ -11667,12 +11666,11 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) { FD->addAttr(NoThrowAttr::CreateImplicit(Context, FD->getLocation())); if (Context.BuiltinInfo.isConst(BuiltinID) && !FD->hasAttr()) FD->addAttr(ConstAttr::CreateImplicit(Context, FD->getLocation())); - if (getLangOpts().CUDA && getLangOpts().CUDATargetOverloads && - Context.BuiltinInfo.isTSBuiltin(BuiltinID) && + if (getLangOpts().CUDA && Context.BuiltinInfo.isTSBuiltin(BuiltinID) && !FD->hasAttr() && !FD->hasAttr()) { - // Assign appropriate attribute depending on CUDA compilation - // mode and the target builtin belongs to. E.g. during host - // compilation, aux builtins are __device__, the rest are __host__. + // Add the appropriate attribute, depending on the CUDA compilation mode + // and which target the builtin belongs to. For example, during host + // compilation, aux builtins are __device__, while the rest are __host__. if (getLangOpts().CUDAIsDevice != Context.BuiltinInfo.isAuxBuiltinID(BuiltinID)) FD->addAttr(CUDADeviceAttr::CreateImplicit(Context, FD->getLocation())); -- cgit v1.2.3