Skip to content

Commit c19911f

Browse files
committed
Fix constructor ordering
1 parent ac09e20 commit c19911f

File tree

2 files changed

+24
-17
lines changed

2 files changed

+24
-17
lines changed

src/qiree/Module.cc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Module::Module(UPModule&& module) : module_{std::move(module)}
118118
//---------------------------------------------------------------------------//
119119
/*!
120120
* Construct with an LLVM module and an entry point.
121+
*
121122
* Useful when there are multiple entry points.
122123
*/
123124
Module::Module(UPModule&& module, std::string const& entrypoint)
@@ -158,14 +159,8 @@ Module::Module(std::string const& filename, std::string const& entrypoint)
158159

159160
//---------------------------------------------------------------------------//
160161
/*!
161-
* Reading a module by parsing an in-memory LLVM IR string.
162+
* Read a module by parsing an in-memory LLVM IR string.
162163
*/
163-
164-
Module::Module() = default;
165-
Module::~Module() = default;
166-
Module::Module(Module&&) = default;
167-
Module& Module::operator=(Module&&) = default;
168-
169164
std::unique_ptr<Module> Module::from_bytes(std::string const& content)
170165
{
171166
llvm::SMDiagnostic err;
@@ -189,6 +184,14 @@ std::unique_ptr<Module> Module::from_bytes(std::string const& content)
189184
return std::make_unique<Module>(std::move(llvm_module));
190185
}
191186

187+
//! Construct in an empty state
188+
Module::Module() = default;
189+
190+
// Default destructor and move
191+
Module::~Module() = default;
192+
Module::Module(Module&&) = default;
193+
Module& Module::operator=(Module&&) = default;
194+
192195
//---------------------------------------------------------------------------//
193196
/*!
194197
* Process entry point attributes.

src/qiree/Module.hh

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,6 @@ class Module
3333
//!@}
3434

3535
public:
36-
// Default empty constructor
37-
Module();
38-
// Externally defined defaults
39-
~Module();
40-
Module(Module&&);
41-
Module& operator=(Module&&);
42-
// Prevent copying
43-
Module(Module const&) = delete;
44-
Module& operator=(Module const&) = delete;
45-
4636
// Reading a module by parsing an in-memory LLVM IR string.
4737
static std::unique_ptr<Module> from_bytes(std::string const & content);
4838

@@ -58,6 +48,20 @@ class Module
5848
// Construct with an LLVM IR file (bitcode or disassembled) and entry point
5949
Module(std::string const& filename, std::string const& entrypoint);
6050

51+
// Construct in an empty state
52+
Module();
53+
54+
// Externally defined defaults
55+
~Module();
56+
Module(Module&&);
57+
Module& operator=(Module&&);
58+
59+
// Prevent copying
60+
Module(Module const&) = delete;
61+
Module& operator=(Module const&) = delete;
62+
63+
//// ACCESSORS ////
64+
6165
// Process entry point attributes
6266
EntryPointAttrs load_entry_point_attrs() const;
6367

0 commit comments

Comments
 (0)