-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make some initial fixes get
core
compiling (#137)
This commit is a grab-bag of smaller fixes required to get Rust's `core` library compiling properly by hieratika. They include: - Adding support for an `i48` type which seems to be required, as well as adding polyfill stubs for such a type. - Adding support for an `i40` type which seems to be required, as well as adding polyfill stubs for such a type. - Changing the `DataLayout` type's query functionality to comply with the layout promotion rules for integers. - Registers all variables inside a function ahead of time to cope with usages before declaration in lexical order but not in execution order. - Changes the handling of GetElementPtr instructions to account for negative indices, which were not apparently allowed from the LangRef, but are encountered in `core`. As GetElementPtr does not access memory, it does make sense that they are allowed, so we now support them here.
- Loading branch information
1 parent
914f3fb
commit 3a774f1
Showing
13 changed files
with
361 additions
and
259 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,26 @@ | ||
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128" | ||
target triple = "riscv64" | ||
|
||
; We declare the necessary functions and constants to avoid unavailable references | ||
@alloc_e547e50f836b5d080f631e710773931f = private unnamed_addr constant <{ ptr, [16 x i8] }> <{ ptr @alloc_e951d9caa9b0332887c975fc323e279a, [16 x i8] c"j\00\00\00\00\00\00\00\9D\01\00\00-\00\00\00" }>, align 8 | ||
@alloc_e951d9caa9b0332887c975fc323e279a = private unnamed_addr constant <{ [106 x i8] }> <{ [106 x i8] c"/nix/store/hahzrgjq3ncgd241r37xm63ydm9xxfp7-rust-mixed/lib/rustlib/src/rust/library/core/src/array/iter.rs" }>, align 1 | ||
@7 = private unnamed_addr constant <{ [4 x i8] }> undef, align 4 | ||
|
||
declare i64 @_ZN4core3ops11index_range10IndexRange3end17h736da45717d9393bE(ptr align 8 %new) | ||
declare { i64, i64 } @_ZN4core3ops11index_range10IndexRange7zero_to17h9efe20b9ab4c8a42E(i64 %0) | ||
|
||
; <core::array::iter::IntoIter<T,_> as core::clone::Clone>::clone | ||
; Function Attrs: noredzone nounwind | ||
define dso_local void @"_ZN79_$LT$core..array..iter..IntoIter$LT$T$C$_$GT$$u20$as$u20$core..clone..Clone$GT$5clone17h19b6a6ce98691d0aE"(ptr sret([32 x i8]) align 8 %_0, ptr align 8 %self) unnamed_addr { | ||
start: | ||
%_10 = alloca [16 x i8], align 8 | ||
br label %repeat_loop_header | ||
|
||
repeat_loop_header: ; preds = %repeat_loop_body, %start | ||
%1 = phi i64 [ 0, %start ], [ %4, %repeat_loop_body ] | ||
br i1 0, label %repeat_loop_body, label %repeat_loop_header | ||
|
||
repeat_loop_body: ; preds = %repeat_loop_header | ||
%4 = add nuw i64 %1, 1 | ||
br label %repeat_loop_header | ||
} |
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
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
Oops, something went wrong.