@@ -174,15 +174,15 @@ class MachOPlatformRuntimeState {
174
174
Error deregisterThreadDataSection (span<const char > ThreadDataSection);
175
175
Error registerObjectPlatformSections (
176
176
ExecutorAddr HeaderAddr,
177
- std::vector<std::pair<string_view, ExecutorAddrRange>> Secs);
177
+ std::vector<std::pair<std:: string_view, ExecutorAddrRange>> Secs);
178
178
Error deregisterObjectPlatformSections (
179
179
ExecutorAddr HeaderAddr,
180
- std::vector<std::pair<string_view, ExecutorAddrRange>> Secs);
180
+ std::vector<std::pair<std:: string_view, ExecutorAddrRange>> Secs);
181
181
182
182
const char *dlerror ();
183
- void *dlopen (string_view Name, int Mode);
183
+ void *dlopen (std:: string_view Name, int Mode);
184
184
int dlclose (void *DSOHandle);
185
- void *dlsym (void *DSOHandle, string_view Symbol);
185
+ void *dlsym (void *DSOHandle, std:: string_view Symbol);
186
186
187
187
int registerAtExit (void (*F)(void *), void *Arg, void *DSOHandle);
188
188
void runAtExits (JITDylibState &JDS);
@@ -194,10 +194,10 @@ class MachOPlatformRuntimeState {
194
194
195
195
private:
196
196
JITDylibState *getJITDylibStateByHeader (void *DSOHandle);
197
- JITDylibState *getJITDylibStateByName (string_view Path);
197
+ JITDylibState *getJITDylibStateByName (std:: string_view Path);
198
198
199
199
Expected<ExecutorAddr> lookupSymbolInJITDylib (void *DSOHandle,
200
- string_view Symbol);
200
+ std:: string_view Symbol);
201
201
202
202
static Error registerObjCSelectors (JITDylibState &JDS);
203
203
static Error registerObjCClasses (JITDylibState &JDS);
@@ -206,7 +206,7 @@ class MachOPlatformRuntimeState {
206
206
static Error registerSwift5Types (JITDylibState &JDS);
207
207
static Error runModInits (JITDylibState &JDS);
208
208
209
- Expected<void *> dlopenImpl (string_view Path, int Mode);
209
+ Expected<void *> dlopenImpl (std:: string_view Path, int Mode);
210
210
Error dlopenFull (JITDylibState &JDS);
211
211
Error dlopenInitialize (JITDylibState &JDS, MachOJITDylibDepInfoMap &DepInfo);
212
212
@@ -220,7 +220,7 @@ class MachOPlatformRuntimeState {
220
220
221
221
std::recursive_mutex JDStatesMutex;
222
222
std::unordered_map<void *, JITDylibState> JDStates;
223
- std::unordered_map<string_view, void *> JDNameToHeader;
223
+ std::unordered_map<std:: string_view, void *> JDNameToHeader;
224
224
225
225
std::mutex ThreadDataSectionsMutex;
226
226
std::map<const char *, size_t > ThreadDataSections;
@@ -321,7 +321,7 @@ Error MachOPlatformRuntimeState::deregisterThreadDataSection(
321
321
322
322
Error MachOPlatformRuntimeState::registerObjectPlatformSections (
323
323
ExecutorAddr HeaderAddr,
324
- std::vector<std::pair<string_view, ExecutorAddrRange>> Secs) {
324
+ std::vector<std::pair<std:: string_view, ExecutorAddrRange>> Secs) {
325
325
ORC_RT_DEBUG ({
326
326
printdbg (" MachOPlatform: Registering object sections for %p.\n " ,
327
327
HeaderAddr.toPtr <void *>());
@@ -383,7 +383,7 @@ bool removeIfPresent(std::vector<span<T>> &V, ExecutorAddrRange R) {
383
383
384
384
Error MachOPlatformRuntimeState::deregisterObjectPlatformSections (
385
385
ExecutorAddr HeaderAddr,
386
- std::vector<std::pair<string_view, ExecutorAddrRange>> Secs) {
386
+ std::vector<std::pair<std:: string_view, ExecutorAddrRange>> Secs) {
387
387
// TODO: Make this more efficient? (maybe unnecessary if removal is rare?)
388
388
// TODO: Add a JITDylib prepare-for-teardown operation that clears all
389
389
// registered sections, causing this function to take the fast-path.
@@ -442,7 +442,7 @@ Error MachOPlatformRuntimeState::deregisterObjectPlatformSections(
442
442
443
443
const char *MachOPlatformRuntimeState::dlerror () { return DLFcnError.c_str (); }
444
444
445
- void *MachOPlatformRuntimeState::dlopen (string_view Path, int Mode) {
445
+ void *MachOPlatformRuntimeState::dlopen (std:: string_view Path, int Mode) {
446
446
ORC_RT_DEBUG ({
447
447
std::string S (Path.data (), Path.size ());
448
448
printdbg (" MachOPlatform::dlopen(\" %s\" )\n " , S.c_str ());
@@ -477,7 +477,8 @@ int MachOPlatformRuntimeState::dlclose(void *DSOHandle) {
477
477
return 0 ;
478
478
}
479
479
480
- void *MachOPlatformRuntimeState::dlsym (void *DSOHandle, string_view Symbol) {
480
+ void *MachOPlatformRuntimeState::dlsym (void *DSOHandle,
481
+ std::string_view Symbol) {
481
482
auto Addr = lookupSymbolInJITDylib (DSOHandle, Symbol);
482
483
if (!Addr) {
483
484
DLFcnError = toString (Addr.takeError ());
@@ -548,7 +549,7 @@ MachOPlatformRuntimeState::getJITDylibStateByHeader(void *DSOHandle) {
548
549
}
549
550
550
551
MachOPlatformRuntimeState::JITDylibState *
551
- MachOPlatformRuntimeState::getJITDylibStateByName (string_view Name) {
552
+ MachOPlatformRuntimeState::getJITDylibStateByName (std:: string_view Name) {
552
553
// FIXME: Avoid creating string once we have C++20.
553
554
auto I = JDNameToHeader.find (std::string (Name.data (), Name.size ()));
554
555
if (I != JDNameToHeader.end ())
@@ -558,7 +559,7 @@ MachOPlatformRuntimeState::getJITDylibStateByName(string_view Name) {
558
559
559
560
Expected<ExecutorAddr>
560
561
MachOPlatformRuntimeState::lookupSymbolInJITDylib (void *DSOHandle,
561
- string_view Sym) {
562
+ std:: string_view Sym) {
562
563
Expected<ExecutorAddr> Result ((ExecutorAddr ()));
563
564
if (auto Err = WrapperFunction<SPSExpected<SPSExecutorAddr>(
564
565
SPSExecutorAddr, SPSString)>::call (&__orc_rt_macho_symbol_lookup_tag,
@@ -710,7 +711,7 @@ Error MachOPlatformRuntimeState::runModInits(JITDylibState &JDS) {
710
711
return Error::success ();
711
712
}
712
713
713
- Expected<void *> MachOPlatformRuntimeState::dlopenImpl (string_view Path,
714
+ Expected<void *> MachOPlatformRuntimeState::dlopenImpl (std:: string_view Path,
714
715
int Mode) {
715
716
// Try to find JITDylib state by name.
716
717
auto *JDS = getJITDylibStateByName (Path);
@@ -976,7 +977,8 @@ __orc_rt_macho_register_object_platform_sections(char *ArgData,
976
977
SPSMachOObjectPlatformSectionsMap)>::
977
978
handle (ArgData, ArgSize,
978
979
[](ExecutorAddr HeaderAddr,
979
- std::vector<std::pair<string_view, ExecutorAddrRange>> &Secs) {
980
+ std::vector<std::pair<std::string_view, ExecutorAddrRange>>
981
+ &Secs) {
980
982
return MachOPlatformRuntimeState::get ()
981
983
.registerObjectPlatformSections (HeaderAddr, std::move (Secs));
982
984
})
@@ -990,7 +992,8 @@ __orc_rt_macho_deregister_object_platform_sections(char *ArgData,
990
992
SPSMachOObjectPlatformSectionsMap)>::
991
993
handle (ArgData, ArgSize,
992
994
[](ExecutorAddr HeaderAddr,
993
- std::vector<std::pair<string_view, ExecutorAddrRange>> &Secs) {
995
+ std::vector<std::pair<std::string_view, ExecutorAddrRange>>
996
+ &Secs) {
994
997
return MachOPlatformRuntimeState::get ()
995
998
.deregisterObjectPlatformSections (HeaderAddr,
996
999
std::move (Secs));
0 commit comments