Skip to content

Commit 03eba20

Browse files
committed
[OpenACC] Fix ast-print of device_type clause
When writing the test for this I seemingly forgot to put 'CHECK' on the lines, so I didn't notice that I was printing the identifiers as pointers rather than their names. This patch corrects the tests and the print behavior.
1 parent 1aff294 commit 03eba20

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clang/lib/AST/OpenACCClause.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ void OpenACCClausePrinter::VisitDeviceTypeClause(
473473
if (Arch.first == nullptr)
474474
OS << "*";
475475
else
476-
OS << Arch.first;
476+
OS << Arch.first->getName();
477477
});
478478
OS << ")";
479479
}

clang/test/AST/ast-print-openacc-compute-construct.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,23 +111,23 @@ void foo() {
111111
bool SomeB;
112112
struct SomeStruct{} SomeStructImpl;
113113

114-
//#pragma acc parallel dtype(SomeB)
114+
//CHECK: #pragma acc parallel dtype(SomeB)
115115
#pragma acc parallel dtype(SomeB)
116116
while(true);
117117

118-
//#pragma acc parallel device_type(SomeStruct)
118+
//CHECK: #pragma acc parallel device_type(SomeStruct)
119119
#pragma acc parallel device_type(SomeStruct)
120120
while(true);
121121

122-
//#pragma acc parallel device_type(int)
122+
//CHECK: #pragma acc parallel device_type(int)
123123
#pragma acc parallel device_type(int)
124124
while(true);
125125

126-
//#pragma acc parallel dtype(bool)
126+
//CHECK: #pragma acc parallel dtype(bool)
127127
#pragma acc parallel dtype(bool)
128128
while(true);
129129

130-
//#pragma acc parallel device_type (SomeStructImpl)
130+
//CHECK: #pragma acc parallel device_type(SomeStructImpl)
131131
#pragma acc parallel device_type (SomeStructImpl)
132132
while(true);
133133
}

0 commit comments

Comments
 (0)