Merge pull request #442 from dbabokin/master
Preprocessor should consider "line comments"
This commit is contained in:
11
module.cpp
11
module.cpp
@@ -1895,11 +1895,16 @@ 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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(LLVM_3_1)
|
||||||
|
inst.getLangOpts().BCPLComment = 1;
|
||||||
|
#else
|
||||||
|
inst.getLangOpts().LineComment = 1;
|
||||||
|
#endif
|
||||||
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();
|
||||||
|
|||||||
Reference in New Issue
Block a user