blob: d67740aa9d66c8a41c369152e03e0a524d6f0237 [file] [log] [blame]
Ted Kremenek5d866252008-11-03 22:33:57 +00001//===--- PlistDiagnostics.cpp - Plist Diagnostics for Paths -----*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the PlistDiagnostics object.
11//
12//===----------------------------------------------------------------------===//
13
Daniel Dunbare1bd4e62009-03-02 06:16:29 +000014#include "clang/Frontend/PathDiagnosticClients.h"
Ted Kremenek5d866252008-11-03 22:33:57 +000015#include "clang/Analysis/PathDiagnostic.h"
16#include "clang/Basic/SourceManager.h"
17#include "clang/Basic/FileManager.h"
Chris Lattner2c78b872009-04-14 23:22:57 +000018#include "clang/Lex/Preprocessor.h"
Ted Kremenek5d866252008-11-03 22:33:57 +000019#include "llvm/Support/Compiler.h"
20#include "llvm/Support/raw_ostream.h"
Ted Kremenek082cb8d2009-03-12 18:41:53 +000021#include "llvm/Support/Casting.h"
Ted Kremenek5d866252008-11-03 22:33:57 +000022#include "llvm/System/Path.h"
23#include "llvm/ADT/DenseMap.h"
24#include "llvm/ADT/SmallVector.h"
Ted Kremenek5d866252008-11-03 22:33:57 +000025using namespace clang;
Ted Kremenek082cb8d2009-03-12 18:41:53 +000026using llvm::cast;
Chris Lattner2b2453a2009-01-17 06:22:33 +000027
28typedef llvm::DenseMap<FileID, unsigned> FIDMap;
Ted Kremenek5d866252008-11-03 22:33:57 +000029
Ted Kremenek4fc82c82008-11-03 23:18:07 +000030namespace clang {
31 class Preprocessor;
32 class PreprocessorFactory;
33}
34
Ted Kremenek5d866252008-11-03 22:33:57 +000035namespace {
36 class VISIBILITY_HIDDEN PlistDiagnostics : public PathDiagnosticClient {
Ted Kremenekddf32da2009-01-21 00:42:24 +000037 std::vector<const PathDiagnostic*> BatchedDiags;
38 const std::string OutputFile;
Chris Lattner2c78b872009-04-14 23:22:57 +000039 const LangOptions &LangOpts;
Ted Kremenek5d866252008-11-03 22:33:57 +000040 public:
Chris Lattner2c78b872009-04-14 23:22:57 +000041 PlistDiagnostics(const std::string& prefix, const LangOptions &LangOpts);
Ted Kremenekddf32da2009-01-21 00:42:24 +000042 ~PlistDiagnostics();
Ted Kremenekbabdd7b2009-03-27 05:06:10 +000043 void HandlePathDiagnostic(const PathDiagnostic* D);
44
Ted Kremenek67f49642009-04-02 00:44:18 +000045 PathGenerationScheme getGenerationScheme() const { return Extensive; }
Ted Kremenekbabdd7b2009-03-27 05:06:10 +000046 bool supportsLogicalOpControlFlow() const { return true; }
Ted Kremenek7dc86642009-03-31 20:22:36 +000047 bool supportsAllBlockEdges() const { return true; }
Ted Kremenek5d866252008-11-03 22:33:57 +000048 };
49} // end anonymous namespace
50
Chris Lattner2c78b872009-04-14 23:22:57 +000051PlistDiagnostics::PlistDiagnostics(const std::string& output,
52 const LangOptions &LO)
53 : OutputFile(output), LangOpts(LO) {}
Ted Kremenek5d866252008-11-03 22:33:57 +000054
Ted Kremenek4fc82c82008-11-03 23:18:07 +000055PathDiagnosticClient*
56clang::CreatePlistDiagnosticClient(const std::string& s,
Chris Lattner2c78b872009-04-14 23:22:57 +000057 Preprocessor *PP, PreprocessorFactory*) {
58 return new PlistDiagnostics(s, PP->getLangOptions());
Ted Kremenek5d866252008-11-03 22:33:57 +000059}
60
Chris Lattnera11d6172009-01-19 07:46:45 +000061static void AddFID(FIDMap &FIDs, llvm::SmallVectorImpl<FileID> &V,
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +000062 const SourceManager* SM, SourceLocation L) {
Ted Kremenek5d866252008-11-03 22:33:57 +000063
Ted Kremenekc472d792009-01-23 20:06:20 +000064 FileID FID = SM->getFileID(SM->getInstantiationLoc(L));
Chris Lattner2b2453a2009-01-17 06:22:33 +000065 FIDMap::iterator I = FIDs.find(FID);
Ted Kremenek5d866252008-11-03 22:33:57 +000066 if (I != FIDs.end()) return;
Chris Lattner2b2453a2009-01-17 06:22:33 +000067 FIDs[FID] = V.size();
68 V.push_back(FID);
Ted Kremenek5d866252008-11-03 22:33:57 +000069}
70
Chris Lattner2c78b872009-04-14 23:22:57 +000071static unsigned GetFID(const FIDMap& FIDs, const SourceManager &SM,
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +000072 SourceLocation L) {
Chris Lattner2c78b872009-04-14 23:22:57 +000073 FileID FID = SM.getFileID(SM.getInstantiationLoc(L));
Chris Lattner2b2453a2009-01-17 06:22:33 +000074 FIDMap::const_iterator I = FIDs.find(FID);
75 assert(I != FIDs.end());
Ted Kremenek5d866252008-11-03 22:33:57 +000076 return I->second;
77}
78
79static llvm::raw_ostream& Indent(llvm::raw_ostream& o, const unsigned indent) {
Ted Kremenek082cb8d2009-03-12 18:41:53 +000080 for (unsigned i = 0; i < indent; ++i) o << ' ';
Ted Kremenek5d866252008-11-03 22:33:57 +000081 return o;
82}
83
Chris Lattner2c78b872009-04-14 23:22:57 +000084static void EmitLocation(llvm::raw_ostream& o, const SourceManager &SM,
85 const LangOptions &LangOpts,
86 SourceLocation L, const FIDMap &FM,
87 unsigned indent, bool extend = false) {
Ted Kremenek5d866252008-11-03 22:33:57 +000088
Chris Lattner2c78b872009-04-14 23:22:57 +000089 FullSourceLoc Loc(SM.getInstantiationLoc(L), const_cast<SourceManager&>(SM));
Ted Kremenekf0763392009-04-05 02:08:28 +000090
91 // Add in the length of the token, so that we cover multi-char tokens.
Chris Lattner2c78b872009-04-14 23:22:57 +000092 unsigned offset =
93 extend ? Lexer::MeasureTokenLength(Loc, SM, LangOpts) - 1 : 0;
Ted Kremenekf0763392009-04-05 02:08:28 +000094
Ted Kremenek5d866252008-11-03 22:33:57 +000095 Indent(o, indent) << "<dict>\n";
96 Indent(o, indent) << " <key>line</key><integer>"
Ted Kremenekf0763392009-04-05 02:08:28 +000097 << Loc.getInstantiationLineNumber() << "</integer>\n";
Ted Kremenek5d866252008-11-03 22:33:57 +000098 Indent(o, indent) << " <key>col</key><integer>"
Ted Kremenekf0763392009-04-05 02:08:28 +000099 << Loc.getInstantiationColumnNumber() + offset << "</integer>\n";
Ted Kremenek5d866252008-11-03 22:33:57 +0000100 Indent(o, indent) << " <key>file</key><integer>"
Ted Kremenekf0763392009-04-05 02:08:28 +0000101 << GetFID(FM, SM, Loc) << "</integer>\n";
Ted Kremenek5d866252008-11-03 22:33:57 +0000102 Indent(o, indent) << "</dict>\n";
103}
104
Chris Lattner2c78b872009-04-14 23:22:57 +0000105static void EmitLocation(llvm::raw_ostream& o, const SourceManager &SM,
106 const LangOptions &LangOpts,
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +0000107 const PathDiagnosticLocation &L, const FIDMap& FM,
Chris Lattner2c78b872009-04-14 23:22:57 +0000108 unsigned indent, bool extend = false) {
109 EmitLocation(o, SM, LangOpts, L.asLocation(), FM, indent, extend);
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +0000110}
111
Chris Lattner2c78b872009-04-14 23:22:57 +0000112static void EmitRange(llvm::raw_ostream& o, const SourceManager &SM,
113 const LangOptions &LangOpts,
114 SourceRange R, const FIDMap &FM,
115 unsigned indent) {
Ted Kremenek5d866252008-11-03 22:33:57 +0000116 Indent(o, indent) << "<array>\n";
Chris Lattner2c78b872009-04-14 23:22:57 +0000117 EmitLocation(o, SM, LangOpts, R.getBegin(), FM, indent+1);
118 EmitLocation(o, SM, LangOpts, R.getEnd(), FM, indent+1, true);
Ted Kremenek5d866252008-11-03 22:33:57 +0000119 Indent(o, indent) << "</array>\n";
120}
121
Ted Kremenekb0b6f722009-03-28 06:40:54 +0000122static llvm::raw_ostream& EmitString(llvm::raw_ostream& o,
123 const std::string& s) {
124 o << "<string>";
125 for (std::string::const_iterator I=s.begin(), E=s.end(); I!=E; ++I) {
126 char c = *I;
127 switch (c) {
128 default: o << c; break;
129 case '&': o << "&amp;"; break;
130 case '<': o << "&lt;"; break;
131 case '>': o << "&gt;"; break;
132 case '\'': o << "&apos;"; break;
133 case '\"': o << "&quot;"; break;
134 }
135 }
136 o << "</string>";
137 return o;
138}
139
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000140static void ReportControlFlow(llvm::raw_ostream& o,
141 const PathDiagnosticControlFlowPiece& P,
Chris Lattner2c78b872009-04-14 23:22:57 +0000142 const FIDMap& FM,
143 const SourceManager &SM,
144 const LangOptions &LangOpts,
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000145 unsigned indent) {
Ted Kremenek5d866252008-11-03 22:33:57 +0000146
Ted Kremenek5d866252008-11-03 22:33:57 +0000147 Indent(o, indent) << "<dict>\n";
148 ++indent;
149
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000150 Indent(o, indent) << "<key>kind</key><string>control</string>\n";
Ted Kremeneka104de82009-04-21 21:03:00 +0000151
Ted Kremenekf48fbc62009-03-27 15:53:20 +0000152 // Emit edges.
153 Indent(o, indent) << "<key>edges</key>\n";
154 ++indent;
155 Indent(o, indent) << "<array>\n";
156 ++indent;
157 for (PathDiagnosticControlFlowPiece::const_iterator I=P.begin(), E=P.end();
158 I!=E; ++I) {
159 Indent(o, indent) << "<dict>\n";
160 ++indent;
161 Indent(o, indent) << "<key>start</key>\n";
Chris Lattner2c78b872009-04-14 23:22:57 +0000162 EmitRange(o, SM, LangOpts, I->getStart().asRange(), FM, indent+1);
Ted Kremenekf48fbc62009-03-27 15:53:20 +0000163 Indent(o, indent) << "<key>end</key>\n";
Chris Lattner2c78b872009-04-14 23:22:57 +0000164 EmitRange(o, SM, LangOpts, I->getEnd().asRange(), FM, indent+1);
Ted Kremenekf48fbc62009-03-27 15:53:20 +0000165 --indent;
166 Indent(o, indent) << "</dict>\n";
167 }
168 --indent;
169 Indent(o, indent) << "</array>\n";
170 --indent;
171
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000172 // Output any helper text.
173 const std::string& s = P.getString();
174 if (!s.empty()) {
Ted Kremenekb0b6f722009-03-28 06:40:54 +0000175 Indent(o, indent) << "<key>alternate</key>";
176 EmitString(o, s) << '\n';
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000177 }
178
179 --indent;
180 Indent(o, indent) << "</dict>\n";
181}
182
183static void ReportEvent(llvm::raw_ostream& o, const PathDiagnosticPiece& P,
Chris Lattner2c78b872009-04-14 23:22:57 +0000184 const FIDMap& FM,
185 const SourceManager &SM,
186 const LangOptions &LangOpts,
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +0000187 unsigned indent) {
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000188
189 Indent(o, indent) << "<dict>\n";
190 ++indent;
191
192 Indent(o, indent) << "<key>kind</key><string>event</string>\n";
193
Ted Kremenek5d866252008-11-03 22:33:57 +0000194 // Output the location.
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +0000195 FullSourceLoc L = P.getLocation().asLocation();
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000196
Ted Kremenek5d866252008-11-03 22:33:57 +0000197 Indent(o, indent) << "<key>location</key>\n";
Chris Lattner2c78b872009-04-14 23:22:57 +0000198 EmitLocation(o, SM, LangOpts, L, FM, indent);
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000199
Ted Kremenek5d866252008-11-03 22:33:57 +0000200 // Output the ranges (if any).
201 PathDiagnosticPiece::range_iterator RI = P.ranges_begin(),
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000202 RE = P.ranges_end();
Ted Kremenek5d866252008-11-03 22:33:57 +0000203
204 if (RI != RE) {
205 Indent(o, indent) << "<key>ranges</key>\n";
206 Indent(o, indent) << "<array>\n";
Ted Kremenekd671c5a2009-02-02 21:45:32 +0000207 ++indent;
Chris Lattner2c78b872009-04-14 23:22:57 +0000208 for (; RI != RE; ++RI)
209 EmitRange(o, SM, LangOpts, *RI, FM, indent+1);
Ted Kremenekd671c5a2009-02-02 21:45:32 +0000210 --indent;
Ted Kremenek5d866252008-11-03 22:33:57 +0000211 Indent(o, indent) << "</array>\n";
212 }
213
214 // Output the text.
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000215 assert(!P.getString().empty());
Ted Kremenek61dc71a2009-03-19 00:42:56 +0000216 Indent(o, indent) << "<key>extended_message</key>\n";
Ted Kremenekb0b6f722009-03-28 06:40:54 +0000217 Indent(o, indent);
218 EmitString(o, P.getString()) << '\n';
Ted Kremenek61dc71a2009-03-19 00:42:56 +0000219
220 // Output the short text.
221 // FIXME: Really use a short string.
Ted Kremenek5d866252008-11-03 22:33:57 +0000222 Indent(o, indent) << "<key>message</key>\n";
Ted Kremenekb0b6f722009-03-28 06:40:54 +0000223 EmitString(o, P.getString()) << '\n';
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000224
Ted Kremenek5d866252008-11-03 22:33:57 +0000225 // Finish up.
226 --indent;
227 Indent(o, indent); o << "</dict>\n";
228}
229
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000230static void ReportMacro(llvm::raw_ostream& o,
231 const PathDiagnosticMacroPiece& P,
Chris Lattner2c78b872009-04-14 23:22:57 +0000232 const FIDMap& FM, const SourceManager &SM,
233 const LangOptions &LangOpts,
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000234 unsigned indent) {
235
236 for (PathDiagnosticMacroPiece::const_iterator I=P.begin(), E=P.end();
237 I!=E; ++I) {
238
239 switch ((*I)->getKind()) {
240 default:
241 break;
242 case PathDiagnosticPiece::Event:
Chris Lattner2c78b872009-04-14 23:22:57 +0000243 ReportEvent(o, cast<PathDiagnosticEventPiece>(**I), FM, SM, LangOpts,
244 indent);
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000245 break;
246 case PathDiagnosticPiece::Macro:
Chris Lattner2c78b872009-04-14 23:22:57 +0000247 ReportMacro(o, cast<PathDiagnosticMacroPiece>(**I), FM, SM, LangOpts,
248 indent);
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000249 break;
250 }
251 }
252}
253
254static void ReportDiag(llvm::raw_ostream& o, const PathDiagnosticPiece& P,
Chris Lattner2c78b872009-04-14 23:22:57 +0000255 const FIDMap& FM, const SourceManager &SM,
256 const LangOptions &LangOpts) {
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000257
258 unsigned indent = 4;
259
260 switch (P.getKind()) {
261 case PathDiagnosticPiece::ControlFlow:
262 ReportControlFlow(o, cast<PathDiagnosticControlFlowPiece>(P), FM, SM,
Chris Lattner2c78b872009-04-14 23:22:57 +0000263 LangOpts, indent);
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000264 break;
265 case PathDiagnosticPiece::Event:
Chris Lattner2c78b872009-04-14 23:22:57 +0000266 ReportEvent(o, cast<PathDiagnosticEventPiece>(P), FM, SM, LangOpts,
267 indent);
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000268 break;
269 case PathDiagnosticPiece::Macro:
Chris Lattner2c78b872009-04-14 23:22:57 +0000270 ReportMacro(o, cast<PathDiagnosticMacroPiece>(P), FM, SM, LangOpts,
271 indent);
Ted Kremenek082cb8d2009-03-12 18:41:53 +0000272 break;
273 }
274}
275
Ted Kremenek5d866252008-11-03 22:33:57 +0000276void PlistDiagnostics::HandlePathDiagnostic(const PathDiagnostic* D) {
Ted Kremenekddf32da2009-01-21 00:42:24 +0000277 if (!D)
278 return;
Ted Kremenek5d866252008-11-03 22:33:57 +0000279
Ted Kremenekddf32da2009-01-21 00:42:24 +0000280 if (D->empty()) {
281 delete D;
282 return;
Ted Kremenek5d866252008-11-03 22:33:57 +0000283 }
284
Ted Kremenek96a69262009-04-02 05:13:24 +0000285 // We need to flatten the locations (convert Stmt* to locations) because
286 // the referenced statements may be freed by the time the diagnostics
287 // are emitted.
288 const_cast<PathDiagnostic*>(D)->flattenLocations();
Ted Kremenekddf32da2009-01-21 00:42:24 +0000289 BatchedDiags.push_back(D);
290}
Ted Kremenek5d866252008-11-03 22:33:57 +0000291
Ted Kremenekddf32da2009-01-21 00:42:24 +0000292PlistDiagnostics::~PlistDiagnostics() {
Ted Kremenek5d866252008-11-03 22:33:57 +0000293
294 // Build up a set of FIDs that we use by scanning the locations and
295 // ranges of the diagnostics.
296 FIDMap FM;
Chris Lattner2b2453a2009-01-17 06:22:33 +0000297 llvm::SmallVector<FileID, 10> Fids;
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +0000298 const SourceManager* SM = 0;
Ted Kremenekc472d792009-01-23 20:06:20 +0000299
300 if (!BatchedDiags.empty())
301 SM = &(*BatchedDiags.begin())->begin()->getLocation().getManager();
Ted Kremenek5d866252008-11-03 22:33:57 +0000302
Ted Kremenekddf32da2009-01-21 00:42:24 +0000303 for (std::vector<const PathDiagnostic*>::iterator DI = BatchedDiags.begin(),
304 DE = BatchedDiags.end(); DI != DE; ++DI) {
305
306 const PathDiagnostic *D = *DI;
307
308 for (PathDiagnostic::const_iterator I=D->begin(), E=D->end(); I!=E; ++I) {
Ted Kremenek5fb5dfb2009-04-01 06:13:56 +0000309 AddFID(FM, Fids, SM, I->getLocation().asLocation());
Ted Kremenekddf32da2009-01-21 00:42:24 +0000310
311 for (PathDiagnosticPiece::range_iterator RI=I->ranges_begin(),
312 RE=I->ranges_end(); RI!=RE; ++RI) {
313 AddFID(FM, Fids, SM, RI->getBegin());
314 AddFID(FM, Fids, SM, RI->getEnd());
315 }
Ted Kremenek5d866252008-11-03 22:33:57 +0000316 }
317 }
318
Ted Kremenekddf32da2009-01-21 00:42:24 +0000319 // Open the file.
Ted Kremenek5d866252008-11-03 22:33:57 +0000320 std::string ErrMsg;
Ted Kremenekddf32da2009-01-21 00:42:24 +0000321 llvm::raw_fd_ostream o(OutputFile.c_str(), false, ErrMsg);
Ted Kremenek5d866252008-11-03 22:33:57 +0000322 if (!ErrMsg.empty()) {
Ted Kremenekddf32da2009-01-21 00:42:24 +0000323 llvm::errs() << "warning: could not creat file: " << OutputFile << '\n';
Ted Kremenek5d866252008-11-03 22:33:57 +0000324 return;
325 }
326
327 // Write the plist header.
328 o << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
Ted Kremenekddf32da2009-01-21 00:42:24 +0000329 "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" "
330 "http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
331 "<plist version=\"1.0\">\n";
Ted Kremenek5d866252008-11-03 22:33:57 +0000332
333 // Write the root object: a <dict> containing...
334 // - "files", an <array> mapping from FIDs to file names
335 // - "diagnostics", an <array> containing the path diagnostics
336 o << "<dict>\n"
337 " <key>files</key>\n"
338 " <array>\n";
339
Chris Lattner2b2453a2009-01-17 06:22:33 +0000340 for (llvm::SmallVectorImpl<FileID>::iterator I=Fids.begin(), E=Fids.end();
Ted Kremenekb0b6f722009-03-28 06:40:54 +0000341 I!=E; ++I) {
342 o << " ";
343 EmitString(o, SM->getFileEntryForID(*I)->getName()) << '\n';
344 }
Ted Kremenek5d866252008-11-03 22:33:57 +0000345
346 o << " </array>\n"
347 " <key>diagnostics</key>\n"
348 " <array>\n";
349
Ted Kremenekddf32da2009-01-21 00:42:24 +0000350 for (std::vector<const PathDiagnostic*>::iterator DI=BatchedDiags.begin(),
351 DE = BatchedDiags.end(); DI!=DE; ++DI) {
352
353 o << " <dict>\n"
354 " <key>path</key>\n";
355
356 const PathDiagnostic *D = *DI;
357 // Create an owning smart pointer for 'D' just so that we auto-free it
358 // when we exit this method.
359 llvm::OwningPtr<PathDiagnostic> OwnedD(const_cast<PathDiagnostic*>(D));
360
361 o << " <array>\n";
362
363 for (PathDiagnostic::const_iterator I=D->begin(), E=D->end(); I != E; ++I)
Chris Lattner2c78b872009-04-14 23:22:57 +0000364 ReportDiag(o, *I, FM, *SM, LangOpts);
Ted Kremenekddf32da2009-01-21 00:42:24 +0000365
366 o << " </array>\n";
367
368 // Output the bug type and bug category.
Ted Kremenekb0b6f722009-03-28 06:40:54 +0000369 o << " <key>description</key>";
370 EmitString(o, D->getDescription()) << '\n';
371 o << " <key>category</key>";
372 EmitString(o, D->getCategory()) << '\n';
373 o << " <key>type</key>";
374 EmitString(o, D->getBugType()) << '\n';
Ted Kremenekca1bada2009-03-27 15:31:11 +0000375
376 // Output the location of the bug.
377 o << " <key>location</key>\n";
Chris Lattner2c78b872009-04-14 23:22:57 +0000378 EmitLocation(o, *SM, LangOpts, D->getLocation(), FM, 2);
Ted Kremenekca1bada2009-03-27 15:31:11 +0000379
Ted Kremenekb0b6f722009-03-28 06:40:54 +0000380 // Close up the entry.
Ted Kremenekca1bada2009-03-27 15:31:11 +0000381 o << " </dict>\n";
Ted Kremenekddf32da2009-01-21 00:42:24 +0000382 }
Ted Kremenek5d866252008-11-03 22:33:57 +0000383
384 o << " </array>\n";
Ted Kremenekddf32da2009-01-21 00:42:24 +0000385
Ted Kremenek5d866252008-11-03 22:33:57 +0000386 // Finish.
Ted Kremenek4fc82c82008-11-03 23:18:07 +0000387 o << "</dict>\n</plist>";
Ted Kremenek5d866252008-11-03 22:33:57 +0000388}