[cfe-commits] r169021 - in /cfe/trunk: include/clang/Basic/SourceManager.h include/clang/Frontend/DiagnosticRenderer.h include/clang/Frontend/TextDiagnostic.h include/clang/Lex/PreprocessorOptions.h lib/Frontend/CompilerInstance.cpp lib/Frontend/DiagnosticRenderer.cpp lib/Frontend/TextDiagnostic.cpp test/Modules/build-fail-notes.m test/Modules/cycles.c test/Modules/epic-fail.m
Dmitri Gribenko
gribozavr at gmail.com
Fri Nov 30 12:00:15 PST 2012
Hi Doug,
On Fri, Nov 30, 2012 at 8:38 PM, Douglas Gregor <dgregor at apple.com> wrote:
> Author: dgregor
> Date: Fri Nov 30 12:38:50 2012
> New Revision: 169021
>
> URL: http://llvm.org/viewvc/llvm-project?rev=169021&view=rev
> Log:
> When an error occurs while building a module on demand, provide "While
> building module 'Foo' imported from..." notes (the same we we provide
> "In file included from..." notes) in the diagnostic, so that we know
> how this module got included in the first place. This is part of
> <rdar://problem/12696425>.
>
> Added:
> cfe/trunk/test/Modules/build-fail-notes.m
> Modified:
> cfe/trunk/include/clang/Basic/SourceManager.h
> cfe/trunk/include/clang/Frontend/DiagnosticRenderer.h
> cfe/trunk/include/clang/Frontend/TextDiagnostic.h
> cfe/trunk/include/clang/Lex/PreprocessorOptions.h
> cfe/trunk/lib/Frontend/CompilerInstance.cpp
> cfe/trunk/lib/Frontend/DiagnosticRenderer.cpp
> cfe/trunk/lib/Frontend/TextDiagnostic.cpp
> cfe/trunk/test/Modules/cycles.c
> cfe/trunk/test/Modules/epic-fail.m
>
> Modified: cfe/trunk/include/clang/Basic/SourceManager.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=169021&r1=169020&r2=169021&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/SourceManager.h (original)
> +++ cfe/trunk/include/clang/Basic/SourceManager.h Fri Nov 30 12:38:50 2012
> @@ -40,6 +40,7 @@
> #include "clang/Basic/SourceLocation.h"
> #include "llvm/Support/Allocator.h"
> #include "llvm/Support/DataTypes.h"
> +#include "llvm/ADT/ArrayRef.h"
> #include "llvm/ADT/PointerIntPair.h"
> #include "llvm/ADT/PointerUnion.h"
> #include "llvm/ADT/IntrusiveRefCntPtr.h"
> @@ -508,6 +509,11 @@
>
> };
>
> +/// \brief The path used when building modules on demand, which is used
> +/// to provide a link between the source managers of the different compiler
> +/// instances.
> +typedef llvm::ArrayRef<std::pair<std::string, FullSourceLoc> > ModuleBuildPath;
> +
It might be the case that I am misunderstanding this abstraction, but
it might be better to call it 'ModuleBuildStack' or
'ModuleBuildBacktrace'.
> /// \brief This class handles loading and caching of source files into memory.
> ///
> /// This object owns the MemoryBuffer objects for all of the loaded
> @@ -645,6 +651,15 @@
>
> mutable llvm::DenseMap<FileID, MacroArgsMap *> MacroArgsCacheMap;
>
> + /// \brief The path of modules being built, which is used to detect
> + /// cycles in the module dependency graph as modules are being built, as
> + /// well as to describe
Incomplete sentence here.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the cfe-commits
mailing list