summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-rw-r--r--clang/Driver/RewriteMacros.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/Driver/RewriteMacros.cpp b/clang/Driver/RewriteMacros.cpp
index 136492517d6..7e8629359d6 100644
--- a/clang/Driver/RewriteMacros.cpp
+++ b/clang/Driver/RewriteMacros.cpp
@@ -115,8 +115,9 @@ void clang::RewriteMacrosInInput(Preprocessor &PP,const std::string &InFileName,
// deleted. Comment out the raw token.
if (RawOffs <= PPOffs) {
// Comment out a whole run of tokens instead of bracketing each one with
- // comments.
- RB.InsertTextAfter(RawOffs, "/*", 2);
+ // comments. Add a leading space if RawTok didn't have one.
+ bool HasSpace = RawTok.hasLeadingSpace();
+ RB.InsertTextAfter(RawOffs, " /*"+HasSpace, 2+!HasSpace);
unsigned EndPos;
// Switch on comment lexing. If we get a comment, we don't want to
OpenPOWER on IntegriCloud