Skip to content

runtime: make LLP64 clean #11976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/Runtime/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
/// According to the Objective-C ABI, this is true only for 64-bit
/// platforms.
#ifndef SWIFT_HAS_ISA_MASKING
#if SWIFT_OBJC_INTEROP && defined(__LP64__)
#if SWIFT_OBJC_INTEROP && __POINTER_WIDTH__ == 64
#define SWIFT_HAS_ISA_MASKING 1
#else
#define SWIFT_HAS_ISA_MASKING 0
Expand Down
2 changes: 1 addition & 1 deletion include/swift/Runtime/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ const ExtraInhabitantsValueWitnessTable METATYPE_VALUE_WITNESS_SYM(Bo); // Built

/// Return the value witnesses for unmanaged pointers.
static inline const ValueWitnessTable &getUnmanagedPointerValueWitnesses() {
#ifdef __LP64__
#if __POINTER_WIDTH__ == 64
return VALUE_WITNESS_SYM(Bi64_);
#else
return VALUE_WITNESS_SYM(Bi32_);
Expand Down
6 changes: 3 additions & 3 deletions stdlib/public/SwiftShims/RefCount.h
Original file line number Diff line number Diff line change
Expand Up @@ -733,14 +733,14 @@ class SideTableRefCountBits : public RefCountBitsT<RefCountNotInline>
template <typename RefCountBits>
class RefCounts {
std::atomic<RefCountBits> refCounts;
#if !__LP64__
#if __POINTER_WIDTH__ == 32
// FIXME: hack - something somewhere is assuming a 3-word header on 32-bit
// See also other fixmes marked "small header for 32-bit"
uintptr_t unused SWIFT_ATTRIBUTE_UNAVAILABLE;
#endif

// Out-of-line slow paths.

LLVM_ATTRIBUTE_NOINLINE
void incrementSlow(RefCountBits oldbits, uint32_t inc);

Expand Down Expand Up @@ -773,7 +773,7 @@ class RefCounts {
// Refcount of a new object is 1.
constexpr RefCounts(Initialized_t)
: refCounts(RefCountBits(0, 1))
#if !__LP64__ && !__has_attribute(unavailable)
#if __POINTER_WIDTH__ == 32 && !__has_attribute(unavailable)
, unused(0)
#endif
{ }
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/ImageInspectionMachO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ constexpr const char TypeMetadataRecordSection[] = "__swift2_types";
template<const char *SECTION_NAME,
void CONSUME_BLOCK(const void *start, uintptr_t size)>
void addImageCallback(const mach_header *mh, intptr_t vmaddr_slide) {
#ifdef __LP64__
#if __POINTER_WIDTH__ == 64
using mach_header_platform = mach_header_64;
assert(mh->magic == MH_MAGIC_64 && "loaded non-64-bit image?!");
#else
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/Metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ namespace {
uint32_t Flags;
uint32_t InstanceStart;
uint32_t InstanceSize;
#ifdef __LP64__
#if __POINTER_WIDTH__ == 64
uint32_t Reserved;
#endif
const uint8_t *IvarLayout;
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/runtime/StaticBinaryELF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
using namespace std;
using namespace llvm;

#ifdef __LP64__
#if __POINTER_WIDTH__ == 64
#define ELFCLASS ELFCLASS64
typedef Elf64_Ehdr Elf_Ehdr;
typedef Elf64_Shdr Elf_Shdr;
Expand Down