Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: experimental/visual_studio_plugin/src/dwarf_reader/parse_state.h

Issue 10928195: First round of dead file removal (Closed) Base URL: https://github.com/samclegg/nativeclient-sdk.git@master
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef DWARF_READER_PARSE_STATE_H_
6 #define DWARF_READER_PARSE_STATE_H_
7
8 #include <stack>
9
10 namespace dwarf_reader {
11
12 /// This class is used to store some basic information about the data currenty
13 /// being parsed out of the binary. It uses stacks because they are useful
14 /// for doing the breadth-first traversal which the DWARF information is laid
15 /// out to facilitate (by being a flattened representation of a tree of
16 /// information entries).
17 class ParseState {
18 public:
19 ParseState()
20 : current_compilation_unit_(NULL) {}
21
22 void set_current_compilation_unit(void *compilation_unit) {
23 current_compilation_unit_ = compilation_unit;
24 };
25 void *current_compilation_unit();
26
27 void PushStackFrame(void * context, uint64 address) {
28 context_stack_.push(context);
29 address_stack_.push(address);
30 };
31
32 void * GetTopStackContext() const {
33 return context_stack_.top();
34 }
35
36 uint64 GetTopStackAddress() const {
37 return address_stack_.top();
38 }
39
40 void PopStackFrame() {
41 context_stack_.pop();
42 address_stack_.pop();
43 };
44
45 private:
46 stack<void*> context_stack_;
47 stack<uint64> address_stack_;
48 void *current_compilation_unit_;
49 };
50
51 } // namespace dwarf_reader
52
53 #endif // DWARF_READER_PARSE_STATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698