This is an archive of the discontinued LLVM Phabricator instance.

preserving #pragma clang assume_nonnull in preprocessed output
ClosedPublic

Authored by zibi on Sep 14 2017, 12:49 PM.

Details

Summary

When #pragma clang assume_nonnull begin || end is present in the source it is completely gone from pre-processed output when compiled with -E or -P. This patch make sure the pragma is preserved. I included 1 test case which checks the presence of this pragma in pre-processor output.

Diff Detail

Repository
rL LLVM

Event Timeline

zibi created this revision.Sep 14 2017, 12:49 PM
efriedma added inline comments.Sep 15 2017, 4:44 PM
lib/Frontend/PrintPreprocessedOutput.cpp
566 ↗(On Diff #115252)

Extra "<<"?

test/Preprocessor/pragma_assume_nonnull.c
29 ↗(On Diff #115252)

This testcase is a little more complicated than it needs to be (the "#if"/"#ifndef" doesn't really add anything).

zibi updated this revision to Diff 115643.Sep 18 2017, 7:28 AM

Addressing the review.

zibi marked 2 inline comments as done.Sep 18 2017, 7:29 AM

Good catch, thank you. I submitted a new patch.

efriedma edited edge metadata.Sep 18 2017, 2:28 PM

It looks like you uploaded a diff against the previous version of the patch instead of trunk?

zibi updated this revision to Diff 115838.Sep 19 2017, 8:16 AM

original + review changes

zibi added a comment.Sep 19 2017, 8:21 AM

Please be aware that I don't have the commit permission yet since this is my first patch. I will rely on somebody to push it to the trunk.

efriedma accepted this revision.Sep 21 2017, 2:38 PM

LGTM.

Do you want me to commit this for you?

This revision is now accepted and ready to land.Sep 21 2017, 2:38 PM
zibi added a comment.Sep 22 2017, 6:09 AM

Yes, please do the commit, thank you.

LGTM.

Do you want me to commit this for you?

zibi added a comment.Sep 27 2017, 6:30 AM

Eli, if you have trouble committing this please let me know. Not sure what is happening.

Oops, sorry, lost track of it; I'll commit it today.

This revision was automatically updated to reflect the committed changes.