This is an archive of the discontinued LLVM Phabricator instance.

Skip Unicode character expansion in assembly files
ClosedPublic

Authored by salari01 on Apr 6 2017, 8:46 AM.

Details

Summary

When using the C preprocessor with assembly files, either with a capital S file extension, or with -xassembler-with-cpp, the Unicode escape sequence \u is ignored. The \u pattern can be used for expanding a macro argument that starts with u.

Diff Detail

Repository
rL LLVM

Event Timeline

salari01 created this revision.Apr 6 2017, 8:46 AM
olista01 edited edge metadata.Apr 7 2017, 2:39 AM

The change itself looks fine, but I have a few comments on the test.

Tests of clang shouldn't actually run the assembler, as I think this one will fail if clang is built without the ARM backend. A better way to write the test would be to just run the preprocessor, and check that the occurrences of \u make it through unmodified.

You should also be able to use clang's -verify option to check the diagnostics, so that you don't need a dummy warning to avoid empty FileCheck input. Grep for expected-no-diagnostics in the existing tests for examples of this.

salari01 updated this revision to Diff 94501.Apr 7 2017, 3:10 AM

Updated test to check preprocessed output instead of the assembled file. Cannot use -verify with the driver, but with -E and -o -, there is no longer a need to have the dummy warning to avoid the FileCheck error.

olista01 accepted this revision.Apr 7 2017, 3:15 AM

LGTM

This revision is now accepted and ready to land.Apr 7 2017, 3:15 AM
This revision was automatically updated to reflect the committed changes.