Commit Graph

4080 Commits

Author SHA1 Message Date
Doug Gregor
e12215b1be Introduce InFlightDiagnostic, a move-only class that will be used to emit "extra" information (ranges, Fix-Its, etc.) for a diagnostic. It's quite similar in design to Clang's DiagnosticBuilder, but slightly cleaner/more restrictive.
Note that I had to re-implement llvm::Optional, since it lamely requires a default constructor. At some point, I'll push a proper implementation back to LLVM.

Swift SVN r845
2011-11-09 17:19:30 +00:00
Chris Lattner
9298082ebb move Diagnostics header to include/swift/AST to match .cpp files.
Swift SVN r782
2011-10-22 00:47:35 +00:00
Chris Lattner
2f434d98fb straighten out identifiers in diagnostics a bit.
Swift SVN r780
2011-10-22 00:39:28 +00:00
Chris Lattner
dfd529ce3a rename diags::foo to diag::foo
Swift SVN r779
2011-10-22 00:36:19 +00:00
Chris Lattner
5e8370dea0 eliminate some printouts from IRGen in favor of real diagnostics.
Swift SVN r777
2011-10-22 00:32:14 +00:00
Chris Lattner
2ac742d7c6 convert the rest of sema to the new diagnostics stuff.
Swift SVN r775
2011-10-22 00:25:35 +00:00
Chris Lattner
0c3b3fe76b use Type and Identifier arguments to diagnostics more uniformly.
Swift SVN r774
2011-10-21 23:32:14 +00:00
Chris Lattner
0c0e65e553 violate diagnostic layering harder, making it fine to cram types into diagnostics.
Lets here it for non-pod's in unions.


Swift SVN r773
2011-10-21 23:25:29 +00:00
Chris Lattner
2f5964abd8 switch TC Coercion over.
Swift SVN r772
2011-10-21 23:19:39 +00:00
Chris Lattner
d36e080d5f switch name binding to the new diagnostics stuffola
Swift SVN r771
2011-10-21 23:00:34 +00:00
Chris Lattner
2092ddeb54 switch the lexer over to the new diagnostics subsystem. Drop the
"no newline at the end of // comment" warning, swift doesn't require
a \n at the end of file.


Swift SVN r770
2011-10-20 21:52:16 +00:00
Chris Lattner
60afdf4842 switch irgen to new diags
Swift SVN r769
2011-10-20 21:29:50 +00:00
Chris Lattner
9f906da738 sink (a copy of) HadError into DiagnosticEngine, so that errors produced by it trigger error returns from main().
Swift SVN r768
2011-10-20 20:55:22 +00:00
Chris Lattner
a1781fed38 switch expr parsing to the new diagnostics subsystem
Swift SVN r766
2011-10-20 20:41:48 +00:00
Chris Lattner
6fcd10e290 deconstify member to make Diag<>'s assignable and otherwise behave as
a proper value type.


Swift SVN r765
2011-10-20 20:27:03 +00:00
Chris Lattner
8c07ba4034 switch parseStmtBrace to the new diagnostics api
Swift SVN r764
2011-10-20 20:18:36 +00:00
Chris Lattner
d8343e9a42 convert parseToken to new diagnostic api
Swift SVN r763
2011-10-20 20:09:04 +00:00
Chris Lattner
96f732b6a2 convert parseType to take a DiagID.
Swift SVN r762
2011-10-20 19:53:00 +00:00
Chris Lattner
f149ab5527 make Identifiers default to be quoted in diagnostic output.
Swift SVN r761
2011-10-19 01:07:31 +00:00
Chris Lattner
ff9d19afbb switch another diagnostic off deprecated calls.
Swift SVN r760
2011-10-19 01:04:18 +00:00
Chris Lattner
fcc547d000 switch parseIdentifier and all its uses to the new diagnostics machinery.
Swift SVN r759
2011-10-19 00:57:50 +00:00
Chris Lattner
3bc1db5776 add convenience support in diagnostics for identifiers. This is a layering violation, to be resolved later.
Swift SVN r758
2011-10-19 00:46:48 +00:00
Chris Lattner
a7c7d64fa0 Switch swift to use SourceLoc instead of SMLoc.
Also use the new getAdvancedLoc() method instead of hacking
on SMLoc directly.

Also fix the warning/note/error methods to forward through ASTContext
instead of being replicated everywhere.



Swift SVN r750
2011-10-18 01:22:29 +00:00
Chris Lattner
3ec9a9720a Add datatypes for swift to represent source locations and ranges, which are
distinct from the SMXXX types.  This is important because SMRange and
SourceRange have subtly different semantics, and is also nice to isolate
SMLoc from swift.


Swift SVN r749
2011-10-18 01:21:29 +00:00
Chris Lattner
44cc26c814 switch to LLVM umbrella header to get stringref.
Swift SVN r746
2011-10-18 00:18:15 +00:00
Doug Gregor
f97641d84c Add support for %select{option1|option2}idx to the diagnostic formatter, and use it in the parser
Swift SVN r739
2011-09-27 00:56:09 +00:00
Doug Gregor
a60a77bb8e C99 variadic macros suck. Use template metaprogramming tricks so we
aren't forced to rely on extensions.


Swift SVN r738
2011-09-27 00:25:56 +00:00
Doug Gregor
c0d0149401 Don't rely on silly GNU extensions. __VA_ARGS__ works fine the way we're using it
Swift SVN r736
2011-09-27 00:02:22 +00:00
Doug Gregor
d7a47dd8bf Don't build zero-length arrays
Swift SVN r735
2011-09-26 23:59:08 +00:00
Doug Gregor
3d15bf3d55 Introduce a diagnostic-formatting engine and port most of the parser's
diagnostics over to it.

There are a few differences between this diagnostic engine and Clang's
engine:
  - Diagnostics are specified by a .def file (Diagnostics.def), rather
  than via tblgen, which drastically simplifies the build and makes
  code completion work when you add a new diagnostic.
  - Calls to the "diagnose()" method are safely typed based on the
  argument types specified in the .def file, so it's harder to write a
  diagnostic whose expected arguments (in the string) and whose actual
  arguments (in the code) don't match.
  - It uses variadic templates, so it hangs with the cool kids.



Swift SVN r734
2011-09-26 23:46:28 +00:00