[AST] Use PrintingPolicy for format string diagnosis
authorJessica Clarke <jrtc27@jrtc27.com>
Tue, 28 Apr 2020 22:43:48 +0000 (23:43 +0100)
committerJessica Clarke <jrtc27@jrtc27.com>
Tue, 28 Apr 2020 22:43:48 +0000 (23:43 +0100)
commit5fee6936b8b241b36fadaf0dcd962e9c9adc8a69
tree3ebec890fccf4bb40b8592de2ae8ee70499240a9
parent8a304606971d4884fef330ea00d6898c9291abff
[AST] Use PrintingPolicy for format string diagnosis

Summary:
This is a small improvement for OpenCL diagnostics, but is also useful
for our CHERI fork, as our __capability qualifier is suppressed from
diagnostics when all pointers are capabilities, only being used when pointers
need to be explicitly opted-in to being capabilities.

Reviewers: rsmith, Anastasia, aaron.ballman

Reviewed By: Anastasia, aaron.ballman

Subscribers: aaron.ballman, arichardson, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78777
clang/lib/AST/FormatString.cpp
clang/test/SemaOpenCL/printf-format-strings.cl