clang  6.0.0svn
PrettyStackTraceLocationContext.h
Go to the documentation of this file.
1 //==- PrettyStackTraceLocationContext.h - show analysis backtrace --*- C++ -*-//
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 #ifndef LLVM_CLANG_LIB_STATICANALYZER_CORE_PRETTYSTACKTRACELOCATIONCONTEXT_H
11 #define LLVM_CLANG_LIB_STATICANALYZER_CORE_PRETTYSTACKTRACELOCATIONCONTEXT_H
12 
14 
15 namespace clang {
16 namespace ento {
17 
18 /// While alive, includes the current analysis stack in a crash trace.
19 ///
20 /// Example:
21 /// \code
22 /// 0. Program arguments: ...
23 /// 1. <eof> parser at end of file
24 /// 2. While analyzing stack:
25 /// #0 void inlined()
26 /// #1 void test()
27 /// 3. crash-trace.c:6:3: Error evaluating statement
28 /// \endcode
29 class PrettyStackTraceLocationContext : public llvm::PrettyStackTraceEntry {
30  const LocationContext *LCtx;
31 public:
33  assert(LCtx);
34  }
35 
36  void print(raw_ostream &OS) const override {
37  OS << "While analyzing stack: \n";
38  LCtx->dumpStack(OS, "\t");
39  }
40 };
41 
42 } // end ento namespace
43 } // end clang namespace
44 
45 #endif
While alive, includes the current analysis stack in a crash trace.
Dataflow Directional Tag Classes.
void dumpStack(raw_ostream &OS, StringRef Indent="") const