mirror of
https://github.com/apple/swift.git
synced 2025-12-25 12:15:36 +01:00
This replaces a number of `#include`-s like this:
```
#include "../../../stdlib/public/SwiftShims/Visibility.h"
```
with this:
```
#include "swift/shims/Visibility.h"
```
This is needed to allow SwiftCompilerSources to use C++ headers which include SwiftShims headers. Currently trying to do that results in errors:
```
swift/swift/include/swift/Demangling/../../../stdlib/public/SwiftShims/module.modulemap:1:8: error: redefinition of module 'SwiftShims'
module SwiftShims {
^
Builds.noindex/swift/swift/bootstrapping0/lib/swift/shims/module.modulemap:1:8: note: previously defined here
module SwiftShims {
^
```
This happens because the headers in both the source dir and the build dir refer to SwiftShims headers by relative path, and both the source root and the build root contain SwiftShims headers (which are equivalent, but since they are located in different dirs, Clang treats them as different modules).
36 lines
1.2 KiB
C++
36 lines
1.2 KiB
C++
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2021 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
///
|
|
/// \file
|
|
///
|
|
/// Implementation of ImageInspection for WebAssembly.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#if defined(__wasm__)
|
|
|
|
#include "swift/shims/MetadataSections.h"
|
|
#include "ImageInspection.h"
|
|
|
|
using namespace swift;
|
|
|
|
int swift::lookupSymbol(const void *address, SymbolInfo *info) {
|
|
// Currently, Wasm doesn't have a standard stable ABI for exporting address <->
|
|
// symbol table, it's work in progress. Also, there is no API to access such
|
|
// information from Wasm binary side. It's accessible only from host VM.
|
|
// See https://github.com/WebAssembly/tool-conventions/blob/main/DynamicLinking.md
|
|
// Seems reasonable to use a stub for now.
|
|
return 0;
|
|
}
|
|
|
|
#endif // defined(__wasm__)
|