-
Notifications
You must be signed in to change notification settings - Fork 10.5k
IRGen: Use clangs's LLVM datalayout #16842
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
aschwaighofer
merged 1 commit into
swiftlang:master
from
aschwaighofer:irgen_use_clangs_datalayout
May 25, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,47 @@ | ||
; RUN: %swiftc_driver_plain -frontend -target x86_64-apple-darwin10 -emit-object %s | ||
|
||
; REQUIRES: CPU=x86_64 | ||
|
||
; Make sure we update the datalayout with the current clang's. clang knows | ||
; better about the ABI intricacies. | ||
; This test case woud crash if we did not do this because of i64:128 in the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/woud/would/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
; string below. | ||
|
||
target datalayout = "e-m:o-i64:128-f80:128-n8:16:32:64-S128" | ||
target triple = "x86_64-apple-macosx10.13.0" | ||
|
||
define swiftcc i64 @"$S11TestBitcode3add1x1yS2i_SitF"(i64, i64) #0 { | ||
entry: | ||
%2 = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %0, i64 %1) | ||
%3 = extractvalue { i64, i1 } %2, 0 | ||
%4 = extractvalue { i64, i1 } %2, 1 | ||
br i1 %4, label %6, label %5 | ||
|
||
ret i64 %3 | ||
|
||
call void @llvm.trap() | ||
unreachable | ||
} | ||
|
||
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64, i64) #1 | ||
|
||
declare void @llvm.trap() #2 | ||
|
||
attributes #0 = { "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"="penryn" "target-features"="+cx16,+fxsr,+mmx,+sahf,+sse,+sse2,+sse3,+sse4.1,+ssse3,+x87" } | ||
attributes #1 = { nounwind readnone speculatable } | ||
attributes #2 = { noreturn nounwind } | ||
|
||
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7} | ||
!llvm.linker.options = !{!8, !9, !10} | ||
|
||
!0 = !{i32 1, !"Objective-C Version", i32 2} | ||
!1 = !{i32 1, !"Objective-C Image Info Version", i32 0} | ||
!2 = !{i32 1, !"Objective-C Image Info Section", !"__DATA,__objc_imageinfo,regular,no_dead_strip"} | ||
!3 = !{i32 4, !"Objective-C Garbage Collection", i32 1536} | ||
!4 = !{i32 1, !"Objective-C Class Properties", i32 64} | ||
!5 = !{i32 1, !"wchar_size", i32 4} | ||
!6 = !{i32 7, !"PIC Level", i32 2} | ||
!7 = !{i32 1, !"Swift Version", i32 6} | ||
!8 = !{!"-lswiftSwiftOnoneSupport"} | ||
!9 = !{!"-lswiftCore"} | ||
!10 = !{!"-lobjc"} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific reason to use
%swiftc_driver_plain -frontend
instead of%swift
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#16885