This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add getSignedSizeType method
ClosedPublic

Authored by alexander-shaposhnikov on Jul 13 2017, 12:51 PM.

Details

Summary

This is a follow-up for the discussion on cfe-dev.
C11 standard refers to the signed counterpart of the size_t type in
the paragraph 7.21.6.1 where it defines d, i, o, u, x, or x conversion specifiers
(in printf format string).
In Clang there is a FIXME (in lib/Analysis/PrintfFormatString.cpp) for this case
(which is not handled correctly at the moment).
This diff adds getSignedSizeType method to TargetInfo and exposes it in ASTContext similarly to
how it is done for getSizeType.
lib/Analysis/PrintfFormatString.cpp is supposed to be changed in a separate commit.

Diff Detail

Repository
rL LLVM

Event Timeline

make comments consistent

alexander-shaposhnikov edited the summary of this revision. (Show Details)Jul 13 2017, 12:57 PM
alexander-shaposhnikov added a reviewer: rnk.
rnk accepted this revision.Jul 13 2017, 1:28 PM

lgtm

This revision is now accepted and ready to land.Jul 13 2017, 1:28 PM
This revision was automatically updated to reflect the committed changes.