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

Side by Side Diff: src/IceFixups.h

Issue 952953002: Subzero: Improve class definition hygiene. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix typo Created 5 years, 10 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
« no previous file with comments | « src/IceELFStreamer.h ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceFixups.h - Assembler fixup kinds ----------*- C++ -*-===// 1 //===- subzero/src/IceFixups.h - Assembler fixup kinds ----------*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file declares generic fixup types. 10 // This file declares generic fixup types.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #ifndef SUBZERO_SRC_ICEFIXUPS_H 14 #ifndef SUBZERO_SRC_ICEFIXUPS_H
15 #define SUBZERO_SRC_ICEFIXUPS_H 15 #define SUBZERO_SRC_ICEFIXUPS_H
16 16
17 #include "IceDefs.h" 17 #include "IceDefs.h"
18 18
19 namespace Ice { 19 namespace Ice {
20 20
21 // Each target and container format has a different namespace of relocations. 21 // Each target and container format has a different namespace of relocations.
22 // This holds the specific target+container format's relocation number. 22 // This holds the specific target+container format's relocation number.
23 typedef uint32_t FixupKind; 23 typedef uint32_t FixupKind;
24 24
25 // Assembler fixups are positions in generated code/data that hold relocation 25 // Assembler fixups are positions in generated code/data that hold relocation
26 // information that needs to be processed before finalizing the code/data. 26 // information that needs to be processed before finalizing the code/data.
27 struct AssemblerFixup { 27 struct AssemblerFixup {
28 AssemblerFixup &operator=(const AssemblerFixup &) = delete;
29
28 public: 30 public:
31 AssemblerFixup() : position_(0), kind_(0), value_(nullptr) {}
32 AssemblerFixup(const AssemblerFixup &) = default;
29 intptr_t position() const { return position_; } 33 intptr_t position() const { return position_; }
30 void set_position(intptr_t Position) { position_ = Position; } 34 void set_position(intptr_t Position) { position_ = Position; }
31 35
32 FixupKind kind() const { return kind_; } 36 FixupKind kind() const { return kind_; }
33 void set_kind(FixupKind Kind) { kind_ = Kind; } 37 void set_kind(FixupKind Kind) { kind_ = Kind; }
34 38
35 RelocOffsetT offset() const; 39 RelocOffsetT offset() const;
36 IceString symbol(const GlobalContext *Ctx) const; 40 IceString symbol(const GlobalContext *Ctx) const;
37 void set_value(const Constant *Value) { value_ = Value; } 41 void set_value(const Constant *Value) { value_ = Value; }
38 42
39 void emit(GlobalContext *Ctx) const; 43 void emit(GlobalContext *Ctx) const;
40 44
41 private: 45 private:
42 intptr_t position_; 46 intptr_t position_;
43 FixupKind kind_; 47 FixupKind kind_;
44 const Constant *value_; 48 const Constant *value_;
45 }; 49 };
46 50
47 typedef std::vector<AssemblerFixup> FixupList; 51 typedef std::vector<AssemblerFixup> FixupList;
48 typedef std::vector<AssemblerFixup *> FixupRefList; 52 typedef std::vector<AssemblerFixup *> FixupRefList;
49 53
50 } // end of namespace Ice 54 } // end of namespace Ice
51 55
52 #endif // SUBZERO_SRC_ICEFIXUPS_H 56 #endif // SUBZERO_SRC_ICEFIXUPS_H
OLDNEW
« no previous file with comments | « src/IceELFStreamer.h ('k') | src/IceGlobalContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698