Skip to content
Snippets Groups Projects

Emit align in LLVM

Merged rarbore2 requested to merge emit-align into main
3 files
+ 9
8
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 2
4
@@ -507,11 +507,10 @@ impl<'a> CPUContext<'a> {
@@ -507,11 +507,10 @@ impl<'a> CPUContext<'a> {
// load.
// load.
write!(
write!(
body,
body,
" {} = load {}, ptr {}, align {}\n",
" {} = load {}, ptr {}\n",
self.get_value(id, false),
self.get_value(id, false),
self.get_type(self_ty),
self.get_type(self_ty),
index_ptr_name,
index_ptr_name,
get_type_alignment(self.types, collect_ty),
)?;
)?;
} else {
} else {
// If this read doesn't reach a primitive type, just return
// If this read doesn't reach a primitive type, just return
@@ -540,10 +539,9 @@ impl<'a> CPUContext<'a> {
@@ -540,10 +539,9 @@ impl<'a> CPUContext<'a> {
// perform a single store of the data value.
// perform a single store of the data value.
write!(
write!(
body,
body,
" store {}, ptr {}, align {}\n",
" store {}, ptr {}\n",
self.get_value(data, true),
self.get_value(data, true),
index_ptr_name,
index_ptr_name,
get_type_alignment(self.types, collect_ty),
)?;
)?;
} else {
} else {
// If the data item being written is not a primitive type,
// If the data item being written is not a primitive type,
Loading