mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 03:29:57 +00:00
[OpenCL] Fix mangling of single-overload builtins
Commit 9a8d477a0e
("[OpenCL] Add builtin function attribute
handling", 2019-11-05) stopped Clang from mangling single-overload
builtins, which is incorrect.
This commit is contained in:
parent
4821d2a014
commit
6713670b17
@ -823,7 +823,8 @@ static void InsertOCLBuiltinDeclarationsFromTable(Sema &S, LookupResult &LR,
|
||||
NewOpenCLBuiltin->addAttr(ConstAttr::CreateImplicit(Context));
|
||||
if (OpenCLBuiltin.IsConv)
|
||||
NewOpenCLBuiltin->addAttr(ConvergentAttr::CreateImplicit(Context));
|
||||
if ((GenTypeMaxCnt > 1 || Len > 1) && !S.getLangOpts().OpenCLCPlusPlus)
|
||||
|
||||
if (!S.getLangOpts().OpenCLCPlusPlus)
|
||||
NewOpenCLBuiltin->addAttr(OverloadableAttr::CreateImplicit(Context));
|
||||
|
||||
LR.addDecl(NewOpenCLBuiltin);
|
||||
|
@ -16,6 +16,13 @@ kernel void test_pure_attr(read_only image1d_t img) {
|
||||
float4 resf = read_imagef(img, 42);
|
||||
}
|
||||
|
||||
// Test that builtins with only one prototype are mangled.
|
||||
// CHECK-LABEL: @test_mangling
|
||||
// CHECK: call i32 @_Z12get_local_idj
|
||||
kernel void test_mangling() {
|
||||
size_t lid = get_local_id(0);
|
||||
}
|
||||
|
||||
// CHECK: attributes [[ATTR_CONST]] =
|
||||
// CHECK-SAME: readnone
|
||||
// CHECK: attributes [[ATTR_PURE]] =
|
||||
|
Loading…
Reference in New Issue
Block a user