summaryrefslogtreecommitdiffstats
path: root/clang/test/Misc/macro-backtrace.c
Commit message (Collapse)AuthorAgeFilesLines
* Switch to a more natural formatting of the macro name printing.Chandler Carruth2011-10-241-11/+11
| | | | | | Suggested by John McCall. llvm-svn: 142836
* Add a testcase for r142121 based on an idea from Richard Smith. Thanks!Chandler Carruth2011-10-161-0/+12
| | | | llvm-svn: 142160
* Remove the leftover partial comment.David Blaikie2011-10-161-1/+0
| | | | llvm-svn: 142138
* I fixed this with r142127; these notes now make sense even w/o the caret.Chandler Carruth2011-10-161-1/+0
| | | | llvm-svn: 142129
* Now that macro expansion notes are real notes and go through the sameChandler Carruth2011-10-161-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | formatting as any other diagnostic, they will be properly line wrapped and otherwise pretty printed. Let's take advantage of that and the new factoring to add some helpful information to them (much like template backtrace notes and other notes): the name of the macro whose expansion is being noted. This makes a world of difference if caret diagnostics are disabled, making the expansion notes actually useful in this case. It also helps ensure that in edge cases the information the user needs is present. Consider: % nl -ba t5.cc 1 #define M(x, y, z) \ 2 y 3 4 M( 5 1, 6 2, 7 3); We now produce: % ./bin/clang -fsyntax-only t5.cc t5.cc:6:3: error: expected unqualified-id 2, ^ t5.cc:2:3: note: expanded from macro: M y ^ 1 error generated. Without the added information in the note, the name of the macro being expanded would never be shown. This also deletes a FIXME to use the diagnostic formatting. It's not yet clear to me that we *can* do this reasonably, and the production of this message was my primary goal here anyways. I'd love any comments or suggestions on improving these notes, their wording, etc. Currently, I need to make them provide more helpful information in the presence of a token-pasting buffer, and I'm pondering adding something along the lines of "expanded from argument N of macro: ...". llvm-svn: 142127
* Now that the structure of this is more reasonably laid out, fix a longChandler Carruth2011-10-161-0/+13
| | | | | | | | | | | | | | | standing deficiency: we were providing no macro backtrace information whenever caret diagnostics were turned off. This sinks the logic for suppressing the code snippet and caret to the code that actually prints tho code snippet and caret. Along the way, clean up the naming of functions, remove some now fixed FIXMEs, and generally improve the wording and logic of this process. Add a test case exerecising this functionality. It is notable that the resulting messages are extremely low quality. I'm working on a follow-up patch that should address this and have left a FIXME in the test case. llvm-svn: 142120
* Add a prefix to the existing test to prepare for more tests of otherChandler Carruth2011-10-161-14/+15
| | | | | | backtrace behavior. llvm-svn: 142119
* Fold two run lines into a single logical one, and move them down belowChandler Carruth2011-10-161-4/+5
| | | | | | | | the important code in this test to make the test more stable. Now adding further tests won't shift the line numbers occuring in the diagnostic output. llvm-svn: 142118
* Rename this test to a more general name in preparation for adding moreChandler Carruth2011-10-161-0/+32
tests to it to cover more of the macro bactrace functionality. llvm-svn: 142116
OpenPOWER on IntegriCloud