r212396 - PlistSupport.h: avoid gcc 'defined but not used' warning
Alp Toker
alp at nuanti.com
Sun Jul 6 00:59:14 PDT 2014
Author: alp
Date: Sun Jul 6 02:59:14 2014
New Revision: 212396
URL: http://llvm.org/viewvc/llvm-project?rev=212396&view=rev
Log:
PlistSupport.h: avoid gcc 'defined but not used' warning
Modified:
cfe/trunk/include/clang/Basic/PlistSupport.h
cfe/trunk/lib/ARCMigrate/PlistReporter.cpp
cfe/trunk/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
Modified: cfe/trunk/include/clang/Basic/PlistSupport.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/PlistSupport.h?rev=212396&r1=212395&r2=212396&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/PlistSupport.h (original)
+++ cfe/trunk/include/clang/Basic/PlistSupport.h Sun Jul 6 02:59:14 2014
@@ -19,12 +19,6 @@ namespace clang {
namespace markup {
typedef llvm::DenseMap<FileID, unsigned> FIDMap;
-static const char *PlistHeader =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" "
- "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
- "<plist version=\"1.0\">\n";
-
static inline void AddFID(FIDMap &FIDs, SmallVectorImpl<FileID> &V,
const SourceManager &SM, SourceLocation L) {
FileID FID = SM.getFileID(SM.getExpansionLoc(L));
@@ -49,6 +43,15 @@ static inline raw_ostream &Indent(raw_os
return o;
}
+static inline raw_ostream &EmitPlistHeader(raw_ostream &o) {
+ static const char *PlistHeader =
+ "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" "
+ "\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
+ "<plist version=\"1.0\">\n";
+ return o << PlistHeader;
+}
+
static inline raw_ostream &EmitInteger(raw_ostream &o, int64_t value) {
o << "<integer>";
o << value;
Modified: cfe/trunk/lib/ARCMigrate/PlistReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/PlistReporter.cpp?rev=212396&r1=212395&r2=212396&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/PlistReporter.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/PlistReporter.cpp Sun Jul 6 02:59:14 2014
@@ -63,8 +63,7 @@ void arcmt::writeARCDiagsToPlist(const s
return;
}
- // Write the plist header.
- o << PlistHeader;
+ EmitPlistHeader(o);
// Write the root object: a <dict> containing...
// - "files", an <array> mapping from FIDs to file names
Modified: cfe/trunk/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp?rev=212396&r1=212395&r2=212396&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp Sun Jul 6 02:59:14 2014
@@ -345,8 +345,7 @@ void PlistDiagnostics::FlushDiagnosticsI
return;
}
- // Write the plist header.
- o << PlistHeader;
+ EmitPlistHeader(o);
// Write the root object: a <dict> containing...
// - "clang_version", the string representation of clang version
More information about the cfe-commits
mailing list