diff options
author | John McCall <rjmccall@apple.com> | 2010-08-26 23:41:50 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-26 23:41:50 +0000 |
commit | f312b1ea179f1c44371f9ee0cd0bc006f612de11 (patch) | |
tree | 41c3e6944395d783ebe193409578392f9e37d4d1 /lib/Sema/Sema.cpp | |
parent | 468e8fbda71a02eba31b4d8282fc1d509b552fbe (diff) |
One who seeks knowledge learns something new every day.
One who seeks the Tao unlearns something new every day.
Less and less remains until you arrive at non-action.
When you arrive at non-action,
nothing will be left undone.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112244 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 2de4d28cab..60e308a982 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -20,6 +20,7 @@ #include "llvm/ADT/APFloat.h" #include "clang/Sema/CXXFieldCollector.h" #include "clang/Sema/ExternalSemaSource.h" +#include "clang/Sema/PrettyDeclStackTrace.h" #include "clang/Sema/Scope.h" #include "clang/Sema/ScopeInfo.h" #include "clang/Sema/SemaConsumer.h" @@ -555,3 +556,21 @@ BlockScopeInfo *Sema::getCurBlock() { // Pin this vtable to this file. ExternalSemaSource::~ExternalSemaSource() {} + +void PrettyDeclStackTraceEntry::print(llvm::raw_ostream &OS) const { + SourceLocation Loc = this->Loc; + if (!Loc.isValid() && TheDecl) Loc = TheDecl->getLocation(); + if (Loc.isValid()) { + Loc.print(OS, S.getSourceManager()); + OS << ": "; + } + OS << Message; + + if (TheDecl && isa<NamedDecl>(TheDecl)) { + std::string Name = cast<NamedDecl>(TheDecl)->getNameAsString(); + if (!Name.empty()) + OS << " '" << Name << '\''; + } + + OS << '\n'; +} |