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

Side by Side Diff: src/IceFixups.h

Issue 1838753002: Subzero: Remove IceString. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes Created 4 years, 8 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/IceELFSection.cpp ('k') | src/IceFixups.cpp » ('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 /// \file 10 /// \file
11 /// \brief Declares generic fixup types. 11 /// \brief Declares generic fixup types.
12 /// 12 ///
13 //===----------------------------------------------------------------------===// 13 //===----------------------------------------------------------------------===//
14 14
15 #ifndef SUBZERO_SRC_ICEFIXUPS_H 15 #ifndef SUBZERO_SRC_ICEFIXUPS_H
16 #define SUBZERO_SRC_ICEFIXUPS_H 16 #define SUBZERO_SRC_ICEFIXUPS_H
17 17
18 #include "IceDefs.h" 18 #include "IceDefs.h"
19 #include "IceStringPool.h"
19 20
20 namespace Ice { 21 namespace Ice {
21 22
22 /// Each target and container format has a different namespace of relocations. 23 /// Each target and container format has a different namespace of relocations.
23 /// This holds the specific target+container format's relocation number. 24 /// This holds the specific target+container format's relocation number.
24 using FixupKind = uint32_t; 25 using FixupKind = uint32_t;
25 26
26 struct ELFSym; 27 struct ELFSym;
27 28
28 /// Assembler fixups are positions in generated code/data that hold relocation 29 /// Assembler fixups are positions in generated code/data that hold relocation
29 /// information that needs to be processed before finalizing the code/data. 30 /// information that needs to be processed before finalizing the code/data.
30 class AssemblerFixup { 31 class AssemblerFixup {
31 AssemblerFixup &operator=(const AssemblerFixup &) = delete; 32 AssemblerFixup &operator=(const AssemblerFixup &) = delete;
32 33
33 public: 34 public:
34 AssemblerFixup() = default; 35 AssemblerFixup() = default;
35 AssemblerFixup(const AssemblerFixup &) = default; 36 AssemblerFixup(const AssemblerFixup &) = default;
36 virtual ~AssemblerFixup() = default; 37 virtual ~AssemblerFixup() = default;
37 intptr_t position() const { return position_; } 38 intptr_t position() const { return position_; }
38 void set_position(intptr_t Position) { position_ = Position; } 39 void set_position(intptr_t Position) { position_ = Position; }
39 40
40 FixupKind kind() const { return kind_; } 41 FixupKind kind() const { return kind_; }
41 void set_kind(FixupKind Kind) { kind_ = Kind; } 42 void set_kind(FixupKind Kind) { kind_ = Kind; }
42 43
43 RelocOffsetT offset() const; 44 RelocOffsetT offset() const;
44 IceString symbol() const; 45 GlobalString symbol() const;
45 46
46 static const Constant *NullSymbol; 47 static const Constant *NullSymbol;
47 bool isNullSymbol() const { return ConstValue == NullSymbol; } 48 bool isNullSymbol() const { return ConstValue == NullSymbol; }
48 49
49 static constexpr AssemblerFixup *NoFixup = nullptr; 50 static constexpr AssemblerFixup *NoFixup = nullptr;
50 51
51 bool valueIsSymbol() const { return ValueIsSymbol; } 52 bool valueIsSymbol() const { return ValueIsSymbol; }
52 void set_value(const Constant *Value) { 53 void set_value(const Constant *Value) {
53 ValueIsSymbol = false; 54 ValueIsSymbol = false;
54 ConstValue = Value; 55 ConstValue = Value;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 const std::string Message; 107 const std::string Message;
107 const size_t NumBytes; 108 const size_t NumBytes;
108 }; 109 };
109 110
110 using FixupList = std::vector<AssemblerFixup>; 111 using FixupList = std::vector<AssemblerFixup>;
111 using FixupRefList = std::vector<AssemblerFixup *>; 112 using FixupRefList = std::vector<AssemblerFixup *>;
112 113
113 } // end of namespace Ice 114 } // end of namespace Ice
114 115
115 #endif // SUBZERO_SRC_ICEFIXUPS_H 116 #endif // SUBZERO_SRC_ICEFIXUPS_H
OLDNEW
« no previous file with comments | « src/IceELFSection.cpp ('k') | src/IceFixups.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698