forked from OSchip/llvm-project
[libclang] Fix "error: conflicts with new declaration with ‘C’ linkage" that gcc
emits but not clang. llvm-svn: 154475
This commit is contained in:
parent
0d94c73c26
commit
7a9c91c407
|
@ -2484,27 +2484,6 @@ clang_createTranslationUnitFromSourceFile(CXIndex CIdx,
|
|||
Options);
|
||||
}
|
||||
|
||||
void cxindex::printDiagsToStderr(ASTUnit *Unit) {
|
||||
if (!Unit)
|
||||
return;
|
||||
|
||||
for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(),
|
||||
DEnd = Unit->stored_diag_end();
|
||||
D != DEnd; ++D) {
|
||||
CXStoredDiagnostic Diag(*D, Unit->getASTContext().getLangOpts());
|
||||
CXString Msg = clang_formatDiagnostic(&Diag,
|
||||
clang_defaultDiagnosticDisplayOptions());
|
||||
fprintf(stderr, "%s\n", clang_getCString(Msg));
|
||||
clang_disposeString(Msg);
|
||||
}
|
||||
#ifdef LLVM_ON_WIN32
|
||||
// On Windows, force a flush, since there may be multiple copies of
|
||||
// stderr and stdout in the file system, all with different buffers
|
||||
// but writing to the same device.
|
||||
fflush(stderr);
|
||||
#endif
|
||||
}
|
||||
|
||||
struct ParseTranslationUnitInfo {
|
||||
CXIndex CIdx;
|
||||
const char *source_filename;
|
||||
|
@ -5831,6 +5810,27 @@ void clang::setThreadBackgroundPriority() {
|
|||
#endif
|
||||
}
|
||||
|
||||
void cxindex::printDiagsToStderr(ASTUnit *Unit) {
|
||||
if (!Unit)
|
||||
return;
|
||||
|
||||
for (ASTUnit::stored_diag_iterator D = Unit->stored_diag_begin(),
|
||||
DEnd = Unit->stored_diag_end();
|
||||
D != DEnd; ++D) {
|
||||
CXStoredDiagnostic Diag(*D, Unit->getASTContext().getLangOpts());
|
||||
CXString Msg = clang_formatDiagnostic(&Diag,
|
||||
clang_defaultDiagnosticDisplayOptions());
|
||||
fprintf(stderr, "%s\n", clang_getCString(Msg));
|
||||
clang_disposeString(Msg);
|
||||
}
|
||||
#ifdef LLVM_ON_WIN32
|
||||
// On Windows, force a flush, since there may be multiple copies of
|
||||
// stderr and stdout in the file system, all with different buffers
|
||||
// but writing to the same device.
|
||||
fflush(stderr);
|
||||
#endif
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
CXString clang_getClangVersion() {
|
||||
|
|
Loading…
Reference in New Issue