21
21
#include < dlfcn.h>
22
22
#endif
23
23
24
- #include < utility>
25
-
26
24
#include " ImageInspection.h"
27
25
28
26
using namespace swift ;
29
27
30
- const char *swift:: SymbolInfo::getFilename () const {
28
+ const char *SymbolInfo::getFilename () const {
31
29
#if defined(_WIN32) && !defined(__CYGWIN__)
32
30
return nullptr ;
33
31
#elif SWIFT_STDLIB_HAS_DLADDR
@@ -37,7 +35,7 @@ const char *swift::SymbolInfo::getFilename() const {
37
35
#endif
38
36
}
39
37
40
- const void *swift:: SymbolInfo::getBaseAddress () const {
38
+ const void *SymbolInfo::getBaseAddress () const {
41
39
#if defined(_WIN32) && !defined(__CYGWIN__)
42
40
return reinterpret_cast <const void *>(_package.si .ModBase );
43
41
#elif SWIFT_STDLIB_HAS_DLADDR
@@ -47,7 +45,7 @@ const void *swift::SymbolInfo::getBaseAddress() const {
47
45
#endif
48
46
}
49
47
50
- const char *swift:: SymbolInfo::getSymbolName () const {
48
+ const char *SymbolInfo::getSymbolName () const {
51
49
#if defined(_WIN32) && !defined(__CYGWIN__)
52
50
return _package.si .Name ;
53
51
#elif SWIFT_STDLIB_HAS_DLADDR
@@ -57,7 +55,7 @@ const char *swift::SymbolInfo::getSymbolName() const {
57
55
#endif
58
56
}
59
57
60
- const void *swift:: SymbolInfo::getSymbolAddress () const {
58
+ const void *SymbolInfo::getSymbolAddress () const {
61
59
#if defined(_WIN32) && !defined(__CYGWIN__)
62
60
return reinterpret_cast <const void *>(_package.si .Address );
63
61
#elif SWIFT_STDLIB_HAS_DLADDR
@@ -67,7 +65,7 @@ const void *swift::SymbolInfo::getSymbolAddress() const {
67
65
#endif
68
66
}
69
67
70
- llvm::Optional<SymbolInfo> swift:: SymbolInfo::lookup (const void *address) {
68
+ llvm::Optional<SymbolInfo> SymbolInfo::lookup (const void *address) {
71
69
llvm::Optional<SymbolInfo> result;
72
70
73
71
#if defined(__wasm__)
@@ -78,21 +76,21 @@ llvm::Optional<SymbolInfo> swift::SymbolInfo::lookup(const void *address) {
78
76
#elif defined(_WIN32) && !defined(__CYGWIN__)
79
77
_swift_win32_withDbgHelpLibrary ([&] (HANDLE hProcess) {
80
78
if (!hProcess) {
81
- return 0 ;
79
+ return ;
82
80
}
83
81
84
82
SymbolInfo info;
85
83
info._package .si .SizeOfStruct = sizeof (SYMBOL_INFO);
86
84
info._package .si .MaxNameLen = MAX_SYM_NAME;
87
85
if (SymFromAddr (hProcess, reinterpret_cast <const DWORD64>(address),
88
86
nullptr , &info._package .si )) {
89
- result = std::move ( info) ;
87
+ result = info;
90
88
}
91
89
});
92
90
#elif SWIFT_STDLIB_HAS_DLADDR
93
91
SymbolInfo info;
94
92
if (dladdr (address, &info._info )) {
95
- result = std::move ( info) ;
93
+ result = info;
96
94
}
97
95
#endif
98
96
0 commit comments