Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 1 | /*===-- CIndexDiagnostics.cpp - Diagnostics C Interface ---------*- C++ -*-===*\ |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 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 | |* Implements the diagnostic functions of the Clang C interface. *| |
| 11 | |* *| |
| 12 | \*===----------------------------------------------------------------------===*/ |
| 13 | #include "CIndexDiagnostic.h" |
| 14 | #include "CIndexer.h" |
| 15 | #include "CXSourceLocation.h" |
| 16 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 17 | #include "clang/Frontend/FrontendDiagnostic.h" |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 18 | #include "llvm/ADT/SmallString.h" |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 19 | #include "llvm/ADT/Twine.h" |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 20 | #include "llvm/Support/MemoryBuffer.h" |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 21 | #include "llvm/Support/raw_ostream.h" |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 22 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 23 | using namespace clang; |
| 24 | using namespace clang::cxloc; |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 25 | using namespace clang::cxstring; |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 26 | using namespace llvm; |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 27 | |
| 28 | //----------------------------------------------------------------------------- |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 29 | // C Interface Routines |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 30 | //----------------------------------------------------------------------------- |
| 31 | extern "C" { |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 32 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 33 | unsigned clang_getNumDiagnostics(CXTranslationUnit Unit) { |
| 34 | ASTUnit *CXXUnit = static_cast<ASTUnit *>(Unit); |
| 35 | return CXXUnit? CXXUnit->diag_size() : 0; |
| 36 | } |
| 37 | |
| 38 | CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index) { |
| 39 | ASTUnit *CXXUnit = static_cast<ASTUnit *>(Unit); |
| 40 | if (!CXXUnit || Index >= CXXUnit->diag_size()) |
| 41 | return 0; |
| 42 | |
| 43 | return new CXStoredDiagnostic(CXXUnit->diag_begin()[Index], |
| 44 | CXXUnit->getASTContext().getLangOptions()); |
| 45 | } |
| 46 | |
| 47 | void clang_disposeDiagnostic(CXDiagnostic Diagnostic) { |
| 48 | CXStoredDiagnostic *Stored = static_cast<CXStoredDiagnostic *>(Diagnostic); |
| 49 | delete Stored; |
| 50 | } |
| 51 | |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 52 | CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options) { |
| 53 | if (!Diagnostic) |
| 54 | return createCXString(""); |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 55 | |
| 56 | CXDiagnosticSeverity Severity = clang_getDiagnosticSeverity(Diagnostic); |
| 57 | |
| 58 | // Ignore diagnostics that should be ignored. |
| 59 | if (Severity == CXDiagnostic_Ignored) |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 60 | return createCXString(""); |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 61 | |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 62 | llvm::SmallString<256> Str; |
| 63 | llvm::raw_svector_ostream Out(Str); |
| 64 | |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 65 | if (Options & CXDiagnostic_DisplaySourceLocation) { |
| 66 | // Print source location (file:line), along with optional column |
| 67 | // and source ranges. |
| 68 | CXFile File; |
| 69 | unsigned Line, Column; |
| 70 | clang_getInstantiationLocation(clang_getDiagnosticLocation(Diagnostic), |
| 71 | &File, &Line, &Column, 0); |
| 72 | if (File) { |
| 73 | CXString FName = clang_getFileName(File); |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 74 | Out << clang_getCString(FName) << ":" << Line << ":"; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 75 | clang_disposeString(FName); |
| 76 | if (Options & CXDiagnostic_DisplayColumn) |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 77 | Out << Column << ":"; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 78 | |
| 79 | if (Options & CXDiagnostic_DisplaySourceRanges) { |
| 80 | unsigned N = clang_getDiagnosticNumRanges(Diagnostic); |
| 81 | bool PrintedRange = false; |
| 82 | for (unsigned I = 0; I != N; ++I) { |
| 83 | CXFile StartFile, EndFile; |
| 84 | CXSourceRange Range = clang_getDiagnosticRange(Diagnostic, I); |
| 85 | |
| 86 | unsigned StartLine, StartColumn, EndLine, EndColumn; |
| 87 | clang_getInstantiationLocation(clang_getRangeStart(Range), |
| 88 | &StartFile, &StartLine, &StartColumn, |
| 89 | 0); |
| 90 | clang_getInstantiationLocation(clang_getRangeEnd(Range), |
| 91 | &EndFile, &EndLine, &EndColumn, 0); |
| 92 | |
| 93 | if (StartFile != EndFile || StartFile != File) |
| 94 | continue; |
| 95 | |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 96 | Out << "{" << StartLine << ":" << StartColumn << "-" |
| 97 | << EndLine << ":" << EndColumn << "}"; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 98 | PrintedRange = true; |
| 99 | } |
| 100 | if (PrintedRange) |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 101 | Out << ":"; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 102 | } |
| 103 | } |
| 104 | |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 105 | Out << " "; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | /* Print warning/error/etc. */ |
| 109 | switch (Severity) { |
| 110 | case CXDiagnostic_Ignored: assert(0 && "impossible"); break; |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 111 | case CXDiagnostic_Note: Out << "note: "; break; |
| 112 | case CXDiagnostic_Warning: Out << "warning: "; break; |
| 113 | case CXDiagnostic_Error: Out << "error: "; break; |
| 114 | case CXDiagnostic_Fatal: Out << "fatal error: "; break; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 115 | } |
| 116 | |
| 117 | CXString Text = clang_getDiagnosticSpelling(Diagnostic); |
| 118 | if (clang_getCString(Text)) |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 119 | Out << clang_getCString(Text); |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 120 | else |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 121 | Out << "<no diagnostic text>"; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 122 | clang_disposeString(Text); |
Douglas Gregor | 274f190 | 2010-02-22 23:17:23 +0000 | [diff] [blame] | 123 | return createCXString(Out.str(), true); |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | unsigned clang_defaultDiagnosticDisplayOptions() { |
| 127 | return CXDiagnostic_DisplaySourceLocation | CXDiagnostic_DisplayColumn; |
| 128 | } |
| 129 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 130 | enum CXDiagnosticSeverity clang_getDiagnosticSeverity(CXDiagnostic Diag) { |
| 131 | CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag); |
| 132 | if (!StoredDiag) |
| 133 | return CXDiagnostic_Ignored; |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 134 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 135 | switch (StoredDiag->Diag.getLevel()) { |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 136 | case Diagnostic::Ignored: return CXDiagnostic_Ignored; |
| 137 | case Diagnostic::Note: return CXDiagnostic_Note; |
| 138 | case Diagnostic::Warning: return CXDiagnostic_Warning; |
| 139 | case Diagnostic::Error: return CXDiagnostic_Error; |
| 140 | case Diagnostic::Fatal: return CXDiagnostic_Fatal; |
| 141 | } |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 142 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 143 | llvm_unreachable("Invalid diagnostic level"); |
| 144 | return CXDiagnostic_Ignored; |
| 145 | } |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 146 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 147 | CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic Diag) { |
| 148 | CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag); |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 149 | if (!StoredDiag || StoredDiag->Diag.getLocation().isInvalid()) |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 150 | return clang_getNullLocation(); |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 151 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 152 | return translateSourceLocation(StoredDiag->Diag.getLocation().getManager(), |
| 153 | StoredDiag->LangOpts, |
| 154 | StoredDiag->Diag.getLocation()); |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 155 | } |
| 156 | |
| 157 | CXString clang_getDiagnosticSpelling(CXDiagnostic Diag) { |
| 158 | CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag); |
| 159 | if (!StoredDiag) |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 160 | return createCXString(""); |
| 161 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 162 | return createCXString(StoredDiag->Diag.getMessage(), false); |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 163 | } |
| 164 | |
Douglas Gregor | a3890ba | 2010-02-08 23:11:56 +0000 | [diff] [blame] | 165 | unsigned clang_getDiagnosticNumRanges(CXDiagnostic Diag) { |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 166 | CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag); |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 167 | if (!StoredDiag || StoredDiag->Diag.getLocation().isInvalid()) |
Douglas Gregor | a3890ba | 2010-02-08 23:11:56 +0000 | [diff] [blame] | 168 | return 0; |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 169 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 170 | return StoredDiag->Diag.range_size(); |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 171 | } |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 172 | |
Douglas Gregor | a3890ba | 2010-02-08 23:11:56 +0000 | [diff] [blame] | 173 | CXSourceRange clang_getDiagnosticRange(CXDiagnostic Diag, unsigned Range) { |
| 174 | CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag); |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 175 | if (!StoredDiag || Range >= StoredDiag->Diag.range_size() || |
| 176 | StoredDiag->Diag.getLocation().isInvalid()) |
Douglas Gregor | a3890ba | 2010-02-08 23:11:56 +0000 | [diff] [blame] | 177 | return clang_getNullRange(); |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 178 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 179 | return translateSourceRange(StoredDiag->Diag.getLocation().getManager(), |
| 180 | StoredDiag->LangOpts, |
| 181 | StoredDiag->Diag.range_begin()[Range]); |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | unsigned clang_getDiagnosticNumFixIts(CXDiagnostic Diag) { |
| 185 | CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag); |
| 186 | if (!StoredDiag) |
| 187 | return 0; |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 188 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 189 | return StoredDiag->Diag.fixit_size(); |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 190 | } |
| 191 | |
Douglas Gregor | 473d701 | 2010-02-19 18:16:06 +0000 | [diff] [blame] | 192 | CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, unsigned FixIt, |
| 193 | CXSourceRange *ReplacementRange) { |
| 194 | CXStoredDiagnostic *StoredDiag |
| 195 | = static_cast<CXStoredDiagnostic *>(Diagnostic); |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 196 | if (!StoredDiag || FixIt >= StoredDiag->Diag.fixit_size() || |
| 197 | StoredDiag->Diag.getLocation().isInvalid()) { |
Douglas Gregor | 473d701 | 2010-02-19 18:16:06 +0000 | [diff] [blame] | 198 | if (ReplacementRange) |
| 199 | *ReplacementRange = clang_getNullRange(); |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 200 | |
| 201 | return createCXString(""); |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 202 | } |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 203 | |
Douglas Gregor | d0ebe08 | 2010-03-31 15:31:50 +0000 | [diff] [blame^] | 204 | const FixItHint &Hint = StoredDiag->Diag.fixit_begin()[FixIt]; |
Douglas Gregor | 473d701 | 2010-02-19 18:16:06 +0000 | [diff] [blame] | 205 | if (ReplacementRange) { |
| 206 | if (Hint.RemoveRange.isInvalid()) { |
| 207 | // Create an empty range that refers to a single source |
| 208 | // location (which is the insertion point). |
| 209 | CXSourceRange Range = { |
| 210 | { (void *)&StoredDiag->Diag.getLocation().getManager(), |
| 211 | (void *)&StoredDiag->LangOpts }, |
| 212 | Hint.InsertionLoc.getRawEncoding(), |
| 213 | Hint.InsertionLoc.getRawEncoding() |
| 214 | }; |
| 215 | |
| 216 | *ReplacementRange = Range; |
| 217 | } else { |
| 218 | // Create a range that covers the entire replacement (or |
| 219 | // removal) range, adjusting the end of the range to point to |
| 220 | // the end of the token. |
| 221 | *ReplacementRange |
| 222 | = translateSourceRange(StoredDiag->Diag.getLocation().getManager(), |
| 223 | StoredDiag->LangOpts, |
| 224 | Hint.RemoveRange); |
| 225 | } |
| 226 | } |
| 227 | |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 228 | return createCXString(Hint.CodeToInsert); |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 229 | } |
Ted Kremenek | ee4db4f | 2010-02-17 00:41:08 +0000 | [diff] [blame] | 230 | |
Douglas Gregor | 5352ac0 | 2010-01-28 00:27:43 +0000 | [diff] [blame] | 231 | } // end extern "C" |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 232 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 233 | void clang::LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath, |
| 234 | unsigned num_unsaved_files, |
| 235 | struct CXUnsavedFile *unsaved_files, |
| 236 | FileManager &FileMgr, |
| 237 | SourceManager &SourceMgr, |
| 238 | SmallVectorImpl<StoredDiagnostic> &Diags) { |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 239 | using llvm::MemoryBuffer; |
| 240 | using llvm::StringRef; |
| 241 | MemoryBuffer *F = MemoryBuffer::getFile(DiagnosticsPath.c_str()); |
| 242 | if (!F) |
| 243 | return; |
| 244 | |
| 245 | // Enter the unsaved files into the file manager. |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 246 | for (unsigned I = 0; I != num_unsaved_files; ++I) { |
| 247 | const FileEntry *File = FileMgr.getVirtualFile(unsaved_files[I].Filename, |
| 248 | unsaved_files[I].Length, |
| 249 | 0); |
| 250 | if (!File) { |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 251 | // FIXME: Hard to localize when we have no diagnostics engine! |
| 252 | Diags.push_back(StoredDiagnostic(Diagnostic::Fatal, |
| 253 | (Twine("could not remap from missing file ") + |
| 254 | unsaved_files[I].Filename).str())); |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 255 | delete F; |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 256 | return; |
| 257 | } |
| 258 | |
| 259 | MemoryBuffer *Buffer |
| 260 | = MemoryBuffer::getMemBuffer(unsaved_files[I].Contents, |
| 261 | unsaved_files[I].Contents + unsaved_files[I].Length); |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 262 | if (!Buffer) { |
| 263 | delete F; |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 264 | return; |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 265 | } |
| 266 | |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 267 | SourceMgr.overrideFileContents(File, Buffer); |
Douglas Gregor | f7353c0 | 2010-03-24 21:04:06 +0000 | [diff] [blame] | 268 | SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User); |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 269 | } |
| 270 | |
| 271 | // Parse the diagnostics, emitting them one by one until we've |
| 272 | // exhausted the data. |
| 273 | StringRef Buffer = F->getBuffer(); |
| 274 | const char *Memory = Buffer.data(), *MemoryEnd = Memory + Buffer.size(); |
| 275 | while (Memory != MemoryEnd) { |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 276 | StoredDiagnostic Stored = StoredDiagnostic::Deserialize(FileMgr, SourceMgr, |
| 277 | Memory, MemoryEnd); |
| 278 | if (!Stored) |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 279 | break; |
Daniel Dunbar | 35b8440 | 2010-01-30 23:31:40 +0000 | [diff] [blame] | 280 | |
Douglas Gregor | a88084b | 2010-02-18 18:08:43 +0000 | [diff] [blame] | 281 | Diags.push_back(Stored); |
| 282 | } |
Douglas Gregor | 0a812cf | 2010-02-18 23:07:20 +0000 | [diff] [blame] | 283 | delete F; |
Douglas Gregor | d93256e | 2010-01-28 06:00:51 +0000 | [diff] [blame] | 284 | } |