@@ -339,6 +339,8 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
339
339
// Each MDNode is a list in the form of "key", N number of values which is
340
340
// the same number of values as their are kernel arguments.
341
341
342
+ const PrintingPolicy &Policy = ASTCtx.getPrintingPolicy ();
343
+
342
344
// MDNode for the kernel argument address space qualifiers.
343
345
SmallVector<llvm::Value*, 8 > addressQuals;
344
346
addressQuals.push_back (llvm::MDString::get (Context, " kernel_arg_addr_space" ));
@@ -372,7 +374,8 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
372
374
pointeeTy.getAddressSpace ())));
373
375
374
376
// Get argument type name.
375
- std::string typeName = pointeeTy.getUnqualifiedType ().getAsString () + " *" ;
377
+ std::string typeName =
378
+ pointeeTy.getUnqualifiedType ().getAsString (Policy) + " *" ;
376
379
377
380
// Turn "unsigned type" to "utype"
378
381
std::string::size_type pos = typeName.find (" unsigned" );
@@ -398,7 +401,7 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
398
401
addressQuals.push_back (Builder.getInt32 (AddrSpc));
399
402
400
403
// Get argument type name.
401
- std::string typeName = ty.getUnqualifiedType ().getAsString ();
404
+ std::string typeName = ty.getUnqualifiedType ().getAsString (Policy );
402
405
403
406
// Turn "unsigned type" to "utype"
404
407
std::string::size_type pos = typeName.find (" unsigned" );
0 commit comments