Unbreak the build for compilers that don't include cstdint everywhere.
[oota-llvm.git] / include / llvm / DebugInfo / DIContext.h
1 //===-- DIContext.h ---------------------------------------------*- 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 // This file defines DIContext, an abstract data structure that holds
11 // debug information data.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_DEBUGINFO_DICONTEXT_H
16 #define LLVM_DEBUGINFO_DICONTEXT_H
17
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/Support/DataTypes.h"
20
21 namespace llvm {
22
23 class raw_ostream;
24
25 /// DILineInfo - a format-neutral container for source line information.
26 class DILineInfo {
27   const char *FileName;
28   uint32_t Line;
29   uint32_t Column;
30 public:
31   DILineInfo(const char *fileName, uint32_t line, uint32_t column)
32     : FileName(fileName), Line(line), Column(column) {}
33
34   const char *getFileName() const { return FileName; }
35   uint32_t getLine() const { return Line; }
36   uint32_t getColumn() const { return Column; }
37 };
38
39 class DIContext {
40 public:
41   virtual ~DIContext();
42
43   /// getDWARFContext - get a context for binary DWARF data.
44   static DIContext *getDWARFContext(bool isLittleEndian,
45                                     StringRef infoSection,
46                                     StringRef abbrevSection,
47                                     StringRef aRangeSection = StringRef(),
48                                     StringRef lineSection = StringRef(),
49                                     StringRef stringSection = StringRef());
50
51   virtual void dump(raw_ostream &OS) = 0;
52
53   virtual DILineInfo getLineInfoForAddress(uint64_t address) = 0;
54 };
55
56 }
57
58 #endif