llvm-project/clang/Driver
Chris Lattner 8488c8297c This reworks some of the Diagnostic interfaces a bit to change how diagnostics
are formed.  In particular, a diagnostic with all its strings and ranges is now
packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a 
ton of random stuff.  This has the benefit of simplifying the interface, making
it more extensible, and allowing us to do more checking for things like access
past the end of the various arrays passed in.

In addition to introducing DiagnosticInfo, this also substantially changes how 
Diagnostic::Report works.  Instead of being passed in all of the info required
to issue a diagnostic, Report now takes only the required info (a location and 
ID) and returns a fresh DiagnosticInfo *by value*.  The caller is then free to
stuff strings and ranges into the DiagnosticInfo with the << operator.  When
the dtor runs on the DiagnosticInfo object (which should happen at the end of
the statement), the diagnostic is actually emitted with all of the accumulated
information.  This is a somewhat tricky dance, but it means that the 
accumulated DiagnosticInfo is allowed to keep pointers to other expression 
temporaries without those pointers getting invalidated.

This is just the minimal change to get this stuff working, but this will allow
us to eliminate the zillions of variant "Diag" methods scattered throughout
(e.g.) sema.  For example, instead of calling:

  Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
       SourceRange(BuiltinLoc, RParenLoc));

We will soon be able to just do:

  Diag(BuiltinLoc, diag::err_overload_no_match)
      << typeNames << SourceRange(BuiltinLoc, RParenLoc));

This scales better to support arbitrary types being passed in (not just 
strings) in a type-safe way.  Go operator overloading?!

llvm-svn: 59502
2008-11-18 07:04:44 +00:00
..
ASTConsumers.cpp Rename 'HTMLDiagnostics.h' to 'PathDiagnosticClients.h' 2008-11-03 22:31:48 +00:00
ASTConsumers.h Added driver option "-cxx-inheritance-view" for viewing the C++ hierarchy of a class in GraphViz. 2008-10-23 23:36:29 +00:00
Analyses.def Hook up the Plist diagnostic client to the driver. 2008-11-03 23:18:07 +00:00
AnalysisConsumer.cpp [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that 2008-11-13 05:09:21 +00:00
AnalysisConsumer.h Hook up the Plist diagnostic client to the driver. 2008-11-03 23:18:07 +00:00
Backend.cpp Obey the FIXMES! 2008-11-13 05:29:02 +00:00
CMakeLists.txt CMake: Builds and installs clang binary and libs (no docs yet). It 2008-10-26 00:56:18 +00:00
CacheTokens.cpp [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that 2008-11-13 05:09:21 +00:00
DependencyFile.cpp Improve dependency file support. 2008-10-27 20:01:06 +00:00
DiagChecker.cpp Remove unneeded CheckASTConsumer function. 2008-10-27 22:03:52 +00:00
HTMLPrint.cpp More #include cleaning 2008-08-11 04:54:23 +00:00
Makefile Use LINK_COMPONENTS instead of hard coding LLVM libraries. 2008-10-24 06:24:13 +00:00
PrintParserCallbacks.cpp Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof expressions, both of values and types. 2008-11-11 17:56:53 +00:00
PrintPreprocessedOutput.cpp [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that 2008-11-13 05:09:21 +00:00
RewriteBlocks.cpp Introduction the DeclarationName class, as a single, general method of 2008-11-17 14:58:09 +00:00
RewriteMacros.cpp [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that 2008-11-13 05:09:21 +00:00
RewriteObjC.cpp This reworks some of the Diagnostic interfaces a bit to change how diagnostics 2008-11-18 07:04:44 +00:00
RewriteTest.cpp Add newline at the end of file, to silence compiler warning. 2008-10-20 08:12:48 +00:00
SerializationTest.cpp [LLVM up] Update for raw_fd_ostream change. This fixes a FIXME that 2008-11-13 05:09:21 +00:00
clang.cpp remove a helper method with only one call site. 2008-11-18 05:05:28 +00:00
clang.h Remove unused function declaration. 2008-11-11 04:48:20 +00:00