aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-11-17 15:35:47 -0800
committerDmitry Vyukov <dvyukov@google.com>2018-11-17 15:46:37 -0800
commitd8004ff2dc60902bdee1eea0ccc4ffaa04dc1e45 (patch)
tree0db9f1488f611819a34a680143d9ab19a744395d /pkg
parent993f4bbae0f61d6e2a8f8974bd68a005f3a8b895 (diff)
pkg/compiler: add vma64 type
8-byte vma is needed in several places in linux descriptions.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/compiler/testdata/all.txt7
-rw-r--r--pkg/compiler/types.go5
2 files changed, 11 insertions, 1 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt
index 6fff34284..6863e5836 100644
--- a/pkg/compiler/testdata/all.txt
+++ b/pkg/compiler/testdata/all.txt
@@ -68,6 +68,13 @@ foo$len_templ(a ptr[in, len_templ1[int8, int16]])
foo$len_var0(a ptr[in, array[string]], b len[a])
foo$len_var1(a ptr[in, array[string]], b ptr[in, len[a, int32]])
+# Pointer type.
+
+foo$ptr(a ptr[in, int64])
+foo$ptr64(a ptr64[in, int64])
+foo$vma(a vma)
+foo$vma64(a vma64)
+
# Void type.
void0 {
diff --git a/pkg/compiler/types.go b/pkg/compiler/types.go
index 777920f57..98edc9d74 100644
--- a/pkg/compiler/types.go
+++ b/pkg/compiler/types.go
@@ -288,7 +288,7 @@ var typeFileoff = &typeDesc{
}
var typeVMA = &typeDesc{
- Names: []string{"vma"},
+ Names: []string{"vma", "vma64"},
CanBeArgRet: canBeArg,
OptArgs: 1,
Args: []namedArg{{Name: "size range", Type: typeArgSizeRange}},
@@ -298,6 +298,9 @@ var typeVMA = &typeDesc{
begin, end = args[0].Value, args[0].Value2
}
base.TypeSize = comp.ptrSize
+ if t.Ident == "vma64" {
+ base.TypeSize = 8
+ }
return &prog.VmaType{
TypeCommon: base.TypeCommon,
RangeBegin: begin,