OLD | NEW |
1 //===- subzero/src/IceGlobalInits.h - Global declarations -------*- C++ -*-===// | 1 //===- subzero/src/IceGlobalInits.h - Global declarations -------*- 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 the representation of function declarations, | 10 // This file declares the representation of function declarations, |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "IceDefs.h" | 23 #include "IceDefs.h" |
24 #include "IceTypes.h" | 24 #include "IceTypes.h" |
25 | 25 |
26 // TODO(kschimpf): Remove ourselves from using LLVM representation for calling | 26 // TODO(kschimpf): Remove ourselves from using LLVM representation for calling |
27 // conventions and linkage types. | 27 // conventions and linkage types. |
28 | 28 |
29 namespace Ice { | 29 namespace Ice { |
30 | 30 |
31 /// Base class for global variable and function declarations. | 31 /// Base class for global variable and function declarations. |
32 class GlobalDeclaration { | 32 class GlobalDeclaration { |
| 33 GlobalDeclaration() = delete; |
33 GlobalDeclaration(const GlobalDeclaration &) = delete; | 34 GlobalDeclaration(const GlobalDeclaration &) = delete; |
34 GlobalDeclaration &operator=(const GlobalDeclaration &) = delete; | 35 GlobalDeclaration &operator=(const GlobalDeclaration &) = delete; |
35 | 36 |
36 public: | 37 public: |
37 /// Discriminator for LLVM-style RTTI. | 38 /// Discriminator for LLVM-style RTTI. |
38 enum GlobalDeclarationKind { | 39 enum GlobalDeclarationKind { |
39 FunctionDeclarationKind, | 40 FunctionDeclarationKind, |
40 VariableDeclarationKind | 41 VariableDeclarationKind |
41 }; | 42 }; |
42 GlobalDeclarationKind getKind() const { return Kind; } | 43 GlobalDeclarationKind getKind() const { return Kind; } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 : Kind(Kind), Linkage(Linkage) {} | 83 : Kind(Kind), Linkage(Linkage) {} |
83 | 84 |
84 const GlobalDeclarationKind Kind; | 85 const GlobalDeclarationKind Kind; |
85 IceString Name; | 86 IceString Name; |
86 llvm::GlobalValue::LinkageTypes Linkage; | 87 llvm::GlobalValue::LinkageTypes Linkage; |
87 }; | 88 }; |
88 | 89 |
89 // Models a function declaration. This includes the type signature of | 90 // Models a function declaration. This includes the type signature of |
90 // the function, its calling conventions, and its linkage. | 91 // the function, its calling conventions, and its linkage. |
91 class FunctionDeclaration : public GlobalDeclaration { | 92 class FunctionDeclaration : public GlobalDeclaration { |
| 93 FunctionDeclaration() = delete; |
92 FunctionDeclaration(const FunctionDeclaration &) = delete; | 94 FunctionDeclaration(const FunctionDeclaration &) = delete; |
93 FunctionDeclaration &operator=(const FunctionDeclaration &) = delete; | 95 FunctionDeclaration &operator=(const FunctionDeclaration &) = delete; |
94 | 96 |
95 public: | 97 public: |
96 static FunctionDeclaration *create(const FuncSigType &Signature, | 98 static FunctionDeclaration *create(const FuncSigType &Signature, |
97 llvm::CallingConv::ID CallingConv, | 99 llvm::CallingConv::ID CallingConv, |
98 llvm::GlobalValue::LinkageTypes Linkage, | 100 llvm::GlobalValue::LinkageTypes Linkage, |
99 bool IsProto); | 101 bool IsProto); |
100 ~FunctionDeclaration() final {} | 102 ~FunctionDeclaration() final {} |
101 const FuncSigType &getSignature() const { return Signature; } | 103 const FuncSigType &getSignature() const { return Signature; } |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 template <class StreamType> | 313 template <class StreamType> |
312 inline StreamType &operator<<(StreamType &Stream, | 314 inline StreamType &operator<<(StreamType &Stream, |
313 const GlobalDeclaration &Addr) { | 315 const GlobalDeclaration &Addr) { |
314 Addr.dump(Stream); | 316 Addr.dump(Stream); |
315 return Stream; | 317 return Stream; |
316 } | 318 } |
317 | 319 |
318 } // end of namespace Ice | 320 } // end of namespace Ice |
319 | 321 |
320 #endif // SUBZERO_SRC_ICEGLOBALINITS_H | 322 #endif // SUBZERO_SRC_ICEGLOBALINITS_H |
OLD | NEW |