-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
36 additions
and
35 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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
class str { | ||
_char_buf: *i8, | ||
_length: i64, | ||
_char_buf: *i8, | ||
_length: i64, | ||
|
||
func __init__(self: *str) -> NULL { | ||
self._char_buf = NULL | ||
self.length = 0 | ||
} | ||
func __init__(self: *str) -> NULL { | ||
self._char_buf = NULL | ||
self.length = 0 | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
%str = type { | ||
i8*, ; 0: _char_buf - pointer to the character buffer | ||
i64, ; 1: length - number of characters in the buffer | ||
i8*, ; 0: _char_buf - pointer to the character buffer | ||
i64, ; 1: length - number of characters in the buffer | ||
} | ||
|
||
define void @str_SEP___init__(%str* %self, i8* %string) nounwind { | ||
; Initiailise '_char_buf' | ||
%1 = getelementptr %str* %self, i64 0, i64, 0 ; get pointer to '_char_buf' | ||
store i8* null, i8** %1 ; store null pointer | ||
; Initiailise '_char_buf' | ||
%1 = getelementptr %str* %self, i64 0, i64, 0 ; get pointer to '_char_buf' | ||
store i8* null, i8** %1 ; store null pointer | ||
|
||
; Initiailise 'length' | ||
%2 = getelementptr %str* %self, i64 0, i64 1 ; get pointer to 'length' | ||
store i64 0, i64* %2 ; store 0 | ||
; Initiailise 'length' | ||
%2 = getelementptr %str* %self, i64 0, i64 1 ; get pointer to 'length' | ||
store i64 0, i64* %2 ; store 0 | ||
|
||
ret void | ||
ret void | ||
} |
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