From d187d2b691bc2be1a961dc03d5534e9f1e181acb Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Sun, 6 Jul 2014 07:59:14 +0000 Subject: [PATCH] PlistSupport.h: avoid gcc 'defined but not used' warning git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212396 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/PlistSupport.h | 15 +++++++++------ lib/ARCMigrate/PlistReporter.cpp | 3 +-- lib/StaticAnalyzer/Core/PlistDiagnostics.cpp | 3 +-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/include/clang/Basic/PlistSupport.h b/include/clang/Basic/PlistSupport.h index d5a347b33f..be1304ef79 100644 --- a/include/clang/Basic/PlistSupport.h +++ b/include/clang/Basic/PlistSupport.h @@ -19,12 +19,6 @@ namespace clang { namespace markup { typedef llvm::DenseMap FIDMap; -static const char *PlistHeader = - "\n" - "\n" - "\n"; - static inline void AddFID(FIDMap &FIDs, SmallVectorImpl &V, const SourceManager &SM, SourceLocation L) { FileID FID = SM.getFileID(SM.getExpansionLoc(L)); @@ -49,6 +43,15 @@ static inline raw_ostream &Indent(raw_ostream &o, const unsigned indent) { return o; } +static inline raw_ostream &EmitPlistHeader(raw_ostream &o) { + static const char *PlistHeader = + "\n" + "\n" + "\n"; + return o << PlistHeader; +} + static inline raw_ostream &EmitInteger(raw_ostream &o, int64_t value) { o << ""; o << value; diff --git a/lib/ARCMigrate/PlistReporter.cpp b/lib/ARCMigrate/PlistReporter.cpp index 09cb50512c..6b34ef0c2b 100644 --- a/lib/ARCMigrate/PlistReporter.cpp +++ b/lib/ARCMigrate/PlistReporter.cpp @@ -63,8 +63,7 @@ void arcmt::writeARCDiagsToPlist(const std::string &outPath, return; } - // Write the plist header. - o << PlistHeader; + EmitPlistHeader(o); // Write the root object: a containing... // - "files", an mapping from FIDs to file names diff --git a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index ff2735db26..ba3ad2ef16 100644 --- a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -345,8 +345,7 @@ void PlistDiagnostics::FlushDiagnosticsImpl( return; } - // Write the plist header. - o << PlistHeader; + EmitPlistHeader(o); // Write the root object: a containing... // - "clang_version", the string representation of clang version -- 2.50.1