Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
__unaligned is not currently mangled in any way in the Itanium ABI. This causes failures when using -fms-extensions and C++ in targets using Itanium ABI. As suggested by @rsmith the simplest thing to do here is actually mangle the qualifier as a vendor extension. This patch also removes the change done in D31976 and updates its test to the new reality. This fixes https://bugs.llvm.org/show_bug.cgi?id=33080 https://bugs.llvm.org/show_bug.cgi?id=33178 Differential Revision: https://reviews.llvm.org/D33398 llvm-svn: 304523
- Loading branch information
Roger Ferrer Ibanez
committed
Jun 2, 2017
1 parent
4d8748a
commit fd9384a
Showing
4 changed files
with
79 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// RUN: %clang_cc1 -triple %itanium_abi_triple -fms-extensions -emit-llvm -o- %s | FileCheck %s | ||
|
||
void fa(__unaligned struct A *) {} | ||
// CHECK: define void @_Z2faPU11__unaligned1A( | ||
|
||
void ga(struct A *, struct A *) {} | ||
// CHECK: define void @_Z2gaP1AS0_( | ||
|
||
void gb(__unaligned struct A *, struct A *) {} | ||
// CHECK: define void @_Z2gbPU11__unaligned1APS_( | ||
|
||
void gc(struct A *, __unaligned struct A *) {} | ||
// CHECK: define void @_Z2gcP1APU11__unalignedS_( | ||
|
||
void gd(__unaligned struct A *, __unaligned struct A *) {} | ||
// CHECK: define void @_Z2gdPU11__unaligned1AS1_( | ||
|
||
void hb(__unaligned struct A *, __unaligned const struct A *) {} | ||
// CHECK: define void @_Z2hbPU11__unaligned1APU11__unalignedKS_( | ||
|
||
void ja(__unaligned struct A *, __unaligned struct A *__unaligned *, __unaligned struct A *__unaligned *__unaligned *) {} | ||
// CHECK: define void @_Z2jaPU11__unaligned1APU11__unalignedS1_PU11__unalignedS3_( | ||
|
||
void jb(__unaligned struct A *, __unaligned struct A **, __unaligned struct A *__unaligned *__unaligned *) {} | ||
// CHECK: @_Z2jbPU11__unaligned1APS1_PU11__unalignedPU11__unalignedS1_( | ||
|
||
template <typename T, typename Q> | ||
void ta(T &, Q *) {} | ||
|
||
void ia(__unaligned struct A &a) { | ||
ta(a, &a); | ||
} | ||
// CHECK: @_Z2taIU11__unaligned1AS1_EvRT_PT0_( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// RUN: %clang_cc1 -triple %itanium_abi_triple -fms-extensions -emit-llvm %s -o- | FileCheck %s | ||
|
||
struct A { | ||
void foo() __unaligned; | ||
void foo() const __unaligned; | ||
void foo() volatile __unaligned; | ||
void foo() const volatile __unaligned; | ||
}; | ||
|
||
void A::foo() __unaligned {} | ||
// CHECK: define void @_ZNU11__unaligned1A3fooEv( | ||
|
||
void A::foo() const __unaligned {} | ||
// CHECK: define void @_ZNU11__unalignedK1A3fooEv( | ||
|
||
void A::foo() volatile __unaligned {} | ||
// CHECK: define void @_ZNU11__unalignedV1A3fooEv( | ||
|
||
void A::foo() const volatile __unaligned {} | ||
// CHECK: define void @_ZNU11__unalignedVK1A3fooEv( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters