[cfe-commits] [PATCH] Correct first-line indentation in preprocessor output

Hal Finkel hfinkel at anl.gov
Wed Jan 9 14:20:31 PST 2013


Currently, the -E output from clang does not produce the correct indentation on the first line. This is because MoveToLine returns false, and when this happens, the regular process for producing initial indentation is skipped. This patch makes sure this does not happen on the first line -- it is not clear to me whether there are other circumstances where the current logic could be problematic.

It looks like calling SourceManager::getPresumedLoc is a relatively expensive operation, so however this is fixed, I assume that we want to minimize calls to that function.

Please review.

Thanks again,
Hal

-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Name: first-line-indent.patch
Type: text/x-patch
Size: 1700 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130109/b1fdbdc2/attachment.bin>


More information about the cfe-commits mailing list