summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-10-03 16:48:27 +0000
committerJustin Lebar <jlebar@google.com>2016-10-03 16:48:27 +0000
commit53b000afc2bb54aa5d16b1392c715cbca214bb0c (patch)
treebd1f6ffa2168383181942e2067e659fa1d426f1a /clang/lib/Sema/SemaOverload.cpp
parente060feb7b1a98bcd083cf53ea3c05bc9eda432bb (diff)
downloadbcm5719-llvm-53b000afc2bb54aa5d16b1392c715cbca214bb0c.tar.gz
bcm5719-llvm-53b000afc2bb54aa5d16b1392c715cbca214bb0c.zip
[CUDA] Clean up some comments in Sema::IsOverload. NFC
llvm-svn: 283121
Diffstat (limited to 'clang/lib/Sema/SemaOverload.cpp')
-rw-r--r--clang/lib/Sema/SemaOverload.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index ecd5bd2b99b..c10a164b738 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -1141,17 +1141,17 @@ bool Sema::IsOverload(FunctionDecl *New, FunctionDecl *Old,
assert((OldTarget != CFT_InvalidTarget) && "Unexpected invalid target.");
- // Don't allow mixing of HD with other kinds. This guarantees that
- // we have only one viable function with this signature on any
- // side of CUDA compilation .
- // __global__ functions can't be overloaded based on attribute
- // difference because, like HD, they also exist on both sides.
+ // Don't allow HD and global functions to overload other functions with the
+ // same signature. We allow overloading based on CUDA attributes so that
+ // functions can have different implementations on the host and device, but
+ // HD/global functions "exist" in some sense on both the host and device, so
+ // should have the same implementation on both sides.
if ((NewTarget == CFT_HostDevice) || (OldTarget == CFT_HostDevice) ||
(NewTarget == CFT_Global) || (OldTarget == CFT_Global))
return false;
- // Allow overloading of functions with same signature, but
- // different CUDA target attributes.
+ // Allow overloading of functions with same signature and different CUDA
+ // target attributes.
return NewTarget != OldTarget;
}
OpenPOWER on IntegriCloud