Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
f9b0ce4e
Commit
f9b0ce4e
authored
9 years ago
by
Manos Koukoutos
Browse files
Options
Downloads
Patches
Plain Diff
Make sure to handle all literals in valueToJVM
parent
ac3f4b04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/scala/leon/codegen/CompilationUnit.scala
+14
-7
14 additions, 7 deletions
src/main/scala/leon/codegen/CompilationUnit.scala
with
14 additions
and
7 deletions
src/main/scala/leon/codegen/CompilationUnit.scala
+
14
−
7
View file @
f9b0ce4e
...
...
@@ -9,7 +9,8 @@ import purescala.Expressions._
import
purescala.Types._
import
purescala.Extractors._
import
purescala.Constructors._
import
codegen.runtime.LeonCodeGenRuntimeMonitor
import
runtime.LeonCodeGenRuntimeMonitor
import
utils.UniqueCounter
import
cafebabe._
...
...
@@ -130,12 +131,21 @@ class CompilationUnit(val ctx: LeonContext,
case
IntLiteral
(
v
)
=>
new
java
.
lang
.
Integer
(
v
)
case
InfiniteIntegerLiteral
(
v
)
=>
new
leon
.
codegen
.
runtime
.
BigInt
(
v
.
toString
)
case
BooleanLiteral
(
v
)
=>
new
java
.
lang
.
Boolean
(
v
)
case
UnitLiteral
()
=>
new
java
.
lang
.
Boolean
(
true
)
case
CharLiteral
(
c
)
=>
new
Character
(
c
)
case
InfiniteIntegerLiteral
(
v
)
=>
new
runtime
.
BigInt
(
v
.
toString
)
case
RealLiteral
(
v
)
=>
new
runtime
.
Real
(
v
.
toString
)
case
GenericValue
(
tp
,
id
)
=>
e
...
...
@@ -278,15 +288,12 @@ class CompilationUnit(val ctx: LeonContext,
throw
CompilationException
(
"Unsupported return value : "
+
e
.
getClass
+
" while expecting "
+
tpe
)
}
var
compiledN
=
0
def
compileExpression
(
e
:
Expr
,
args
:
Seq
[
Identifier
])(
implicit
ctx
:
LeonContext
)
:
CompiledExpression
=
{
if
(
e
.
getType
==
Untyped
)
{
throw
new
Unsupported
(
e
,
s
"Cannot compile untyped expression."
)
}
compiledN
+=
1
val
id
=
exprCounter
.
nextGlobal
val
cName
=
"Leon$CodeGen$Expr$"
+
id
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment