arm: Support pac_key_* register operand for MRS/MSR in Armv8.1-M Mainline
[binutils-gdb.git] / gprofng / src / SourceFile.h
blob05d940c758c74ee121fadbbf88262fc01f4ca62b
1 /* Copyright (C) 2021-2024 Free Software Foundation, Inc.
2 Contributed by Oracle.
4 This file is part of GNU Binutils.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
21 #ifndef _SOURCEFILE_H
22 #define _SOURCEFILE_H
24 #include "Histable.h"
25 #include "Map.h"
27 template <typename Key_t, typename Value_t> class Map;
29 #define SOURCE_FLAG_UNKNOWN 0x01
31 class SourceFile : public HistableFile
33 public:
35 enum OpenStatus
37 OS_OK,
38 OS_NOTREAD,
39 OS_NOSRC,
40 OS_TIMESRC
43 SourceFile (const char *file_name);
44 virtual ~SourceFile ();
45 virtual void set_name (char *);
46 virtual char *get_name (NameFormat = NA);
48 bool readSource ();
49 Vector<Function *> *get_functions ();
50 DbeLine *find_dbeline (Function *func, int lineno);
51 char *getLine (int lineno);
53 int
54 getLineCount ()
56 return srcLines ? srcLines->size () : 0;
59 ino64_t
60 getInode ()
62 return srcInode;
65 time_t
66 getMTime ()
68 return srcMTime;
71 void
72 setMTime (time_t tm)
74 srcMTime = tm;
77 bool
78 isTmp ()
80 return isTmpFile;
83 void
84 setTmp (bool set)
86 isTmpFile = set;
89 Histable_type
90 get_type ()
92 return SOURCEFILE;
95 DbeLine *
96 find_dbeline (int lineno)
98 return find_dbeline (NULL, lineno);
101 unsigned int flags;
103 private:
104 static int curId; // object id
105 OpenStatus status;
106 ino64_t srcInode; // Inode number of source file
107 time_t srcMTime; // Creating time for source
108 Vector<char *> *srcLines; // array of pointers to lines in source
109 bool isTmpFile; // Temporary src file to be deleted
111 Vector<DbeLine*> *lines;
112 Map<int, DbeLine*> *dbeLines;
113 Map<Function *, Function *> *functions;
114 bool read_stabs;
117 #endif