This is an archive of the discontinued LLVM Phabricator instance.

Asm preprocessor fix for unknown hash-lines
Needs ReviewPublic

Authored by andrew.zhogin on Mar 17 2016, 5:14 AM.

Details

Summary

clang/lib/Frontend/PrintPreprocessedOutput.cpp has a problem with unknown pragmas.
It inserts an additional empty line after each unrecognized pragma.
It means such a file:

# some comment 1
# some comment 2
# some comment 3

Will be preprocessed (clang -cc1 -E -x assembler-with-cpp) into:

# some comment 1

# some comment 2

# some comment 3

And it breaks debug info (generate wrong line numbers).

For sure, '#' is not right symbol for llvm assembly comments, but it is still a bug.

Here is patch to fix such behaviour.

Diff Detail

Event Timeline

andrew.zhogin retitled this revision from to Asm preprocessor fix for unknown hash-lines.
andrew.zhogin updated this object.
andrew.zhogin added reviewers: jordan_rose, bkramer.
andrew.zhogin added a subscriber: cfe-commits.
andrew.zhogin updated this object.
andrew.zhogin edited the summary of this revision. (Show Details)Jun 30 2017, 10:25 AM
andrew.zhogin added a reviewer: rsmith.
andrew.zhogin added a project: Restricted Project.

Updated to the current repository state.