r354990 - [NFC] minor revision of r354929 [CUDA][HIP] Check calling convention based on function target

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 27 07:46:29 PST 2019


Author: yaxunl
Date: Wed Feb 27 07:46:29 2019
New Revision: 354990

URL: http://llvm.org/viewvc/llvm-project?rev=354990&view=rev
Log:
[NFC] minor revision of r354929 [CUDA][HIP] Check calling convention based on function target

Add comments and move a variable to if block.

Differential Revision: https://reviews.llvm.org/D57716

Modified:
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=354990&r1=354989&r2=354990&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Feb 27 07:46:29 2019
@@ -4617,8 +4617,12 @@ bool Sema::CheckCallingConvAttr(const Pa
 
   TargetInfo::CallingConvCheckResult A = TargetInfo::CCCR_OK;
   const TargetInfo &TI = Context.getTargetInfo();
-  auto *Aux = Context.getAuxTargetInfo();
+  // CUDA functions may have host and/or device attributes which indicate
+  // their targeted execution environment, therefore the calling convention
+  // of functions in CUDA should be checked against the target deduced based
+  // on their host/device attributes.
   if (LangOpts.CUDA) {
+    auto *Aux = Context.getAuxTargetInfo();
     auto CudaTarget = IdentifyCUDATarget(FD);
     bool CheckHost = false, CheckDevice = false;
     switch (CudaTarget) {




More information about the cfe-commits mailing list