Fix for #441: Prepocessor complains on code commented out by //

This commit is contained in:
Dmitry Babokin
2013-03-12 18:55:55 +04:00
parent d760d67598
commit 01992006b2

View File

@@ -1895,11 +1895,12 @@ Module::execPreprocessor(const char *infilename, llvm::raw_string_ostream *ostre
if (g->cppArgs[i].substr(0,2) == "-D") { if (g->cppArgs[i].substr(0,2) == "-D") {
opts.addMacroDef(g->cppArgs[i].substr(2)); opts.addMacroDef(g->cppArgs[i].substr(2));
} }
} }
inst.getLangOpts().LineComment = 1;
inst.createPreprocessor(); inst.createPreprocessor();
clang::LangOptions langOptions; diagPrinter->BeginSourceFile(inst.getLangOpts(), &inst.getPreprocessor());
diagPrinter->BeginSourceFile(langOptions, &inst.getPreprocessor());
clang::DoPrintPreprocessedInput(inst.getPreprocessor(), clang::DoPrintPreprocessedInput(inst.getPreprocessor(),
ostream, inst.getPreprocessorOutputOpts()); ostream, inst.getPreprocessorOutputOpts());
diagPrinter->EndSourceFile(); diagPrinter->EndSourceFile();