[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

llvm-svn: 354990
This commit is contained in:
Yaxun Liu 2019-02-27 15:46:29 +00:00
parent e3b6d11038
commit 785cbd850b
1 changed files with 5 additions and 1 deletions

View File

@ -4617,8 +4617,12 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC,
TargetInfo::CallingConvCheckResult A = TargetInfo::CCCR_OK; TargetInfo::CallingConvCheckResult A = TargetInfo::CCCR_OK;
const TargetInfo &TI = Context.getTargetInfo(); 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) { if (LangOpts.CUDA) {
auto *Aux = Context.getAuxTargetInfo();
auto CudaTarget = IdentifyCUDATarget(FD); auto CudaTarget = IdentifyCUDATarget(FD);
bool CheckHost = false, CheckDevice = false; bool CheckHost = false, CheckDevice = false;
switch (CudaTarget) { switch (CudaTarget) {