This is an archive of the discontinued LLVM Phabricator instance.

TypePrinter print __restrict if not in C99 mode
ClosedPublic

Authored by jpienaar on Mar 3 2015, 3:31 PM.

Details

Reviewers
eliben
rnk
Summary

restrict is a keyword in C99 but not in C++ while clang accepts restrict for C++ code. Modify the TypePrinter to print restrict when not processing C99 code.

Printing restrict in C++ was problematic as printing the argument of

int f(int * __restrict a) { ... }

resulted in

int *restrict a

which is incorrect.

Diff Detail

Event Timeline

jpienaar updated this revision to Diff 21150.Mar 3 2015, 3:31 PM
jpienaar retitled this revision from to TypePrinter print __restrict if not in C99 mode.
jpienaar updated this object.
jpienaar edited the test plan for this revision. (Show Details)
jpienaar added reviewers: eliben, rnk.
jpienaar added a subscriber: Unknown Object (MLST).
rnk accepted this revision.Mar 3 2015, 3:57 PM
rnk edited edge metadata.

lgtm

This revision is now accepted and ready to land.Mar 3 2015, 3:57 PM
eliben accepted this revision.Mar 3 2015, 3:58 PM
eliben edited edge metadata.

LGTM

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in rL231179.