From ba58ab63bf3409a20ab5a9568dbb64f4369512e9 Mon Sep 17 00:00:00 2001
From: Julien Lopez <julien.lopez@lri.fr>
Date: Wed, 20 Sep 2017 17:15:37 +0200
Subject: [PATCH] Update to new Truffle version

---
 .../src/com/oracle/truffle/r/engine/RExecute.java           | 2 +-
 .../com/oracle/truffle/r/engine/TruffleRLanguageImpl.java   | 2 +-
 .../oracle/truffle/r/nodes/qirinterface/QIRInterface.java   | 4 ++--
 .../truffle/r/nodes/qirinterface/QIRTranslateVisitor.java   | 6 +++---
 .../com/oracle/truffle/r/nodes/query/RQIRWrapperNode.java   | 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RExecute.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RExecute.java
index 2b0b2a3201..9c7aeb80ef 100644
--- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RExecute.java
+++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/RExecute.java
@@ -15,6 +15,6 @@ public class RExecute extends UDF {
         final Object res = v.get();
         if (res instanceof Serializable)
             return res.toString();
-        return v.getSourceLocation().getCode();
+        return v.getSourceLocation().getCharacters().toString();
     }
 }
diff --git a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguageImpl.java b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguageImpl.java
index 382f3e4788..247a47e9d6 100644
--- a/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguageImpl.java
+++ b/com.oracle.truffle.r.engine/src/com/oracle/truffle/r/engine/TruffleRLanguageImpl.java
@@ -256,7 +256,7 @@ public final class TruffleRLanguageImpl extends TruffleRLanguage implements Scop
             if (o instanceof Serializable)
                 res = new RValue((Serializable) o);
             else
-                res = new RValue(v.getSourceLocation().getCode());
+                res = new RValue(v.getSourceLocation().getCharacters().toString());
             valueCache.put(program, res);
             return res;
         } catch (Exception e) {
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRInterface.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRInterface.java
index d888147f80..b2aac204a7 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRInterface.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRInterface.java
@@ -241,7 +241,7 @@ public final class QIRInterface {
         final Value v = vm.eval(source);
 
         if (v == null)
-            throw new RuntimeException("No function main() defined in SL source file." + source.getCode());
+            throw new RuntimeException("No function main() defined in SL source file." + source.getCharacters().toString());
         return RToQIRType(v.getSourceLocation(), v.get());
     }
 
@@ -262,7 +262,7 @@ public final class QIRInterface {
         } catch (UnsupportedOperationException e) {
             final SourceSection funSrc = fun.getCallTarget().getRootNode().getSourceSection();
             // TODO: Handle dependencies
-            return new QIRTruffleNode(funSrc, "r", QIRInterface::execute, QIRInterface::apply, funSrc.getCode());
+            return new QIRTruffleNode(funSrc, "r", QIRInterface::execute, QIRInterface::apply, funSrc.getCharacters().toString());
         }
     }
 }
\ No newline at end of file
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRTranslateVisitor.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRTranslateVisitor.java
index 4b4f009e8b..4565e76ba3 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRTranslateVisitor.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/qirinterface/QIRTranslateVisitor.java
@@ -54,17 +54,17 @@ public final class QIRTranslateVisitor implements RSyntaxNodeVisitor<QIRNode> {
 
     @Override
     public final QIRNode visit(final WhileNode whileNode) {
-        return new QIRTruffleNode(whileNode.getSourceSection(), "r", QIRInterface::execute, QIRInterface::apply, whileNode.getSourceSection().getCode());
+        return new QIRTruffleNode(whileNode.getSourceSection(), "r", QIRInterface::execute, QIRInterface::apply, whileNode.getSourceSection().getCharacters().toString());
     }
 
     @Override
     public final QIRNode visit(final ForNode forNode) {
-        return new QIRTruffleNode(forNode.getSourceSection(), "r", QIRInterface::execute, QIRInterface::apply, forNode.getSourceSection().getCode());
+        return new QIRTruffleNode(forNode.getSourceSection(), "r", QIRInterface::execute, QIRInterface::apply, forNode.getSourceSection().getCharacters().toString());
     }
 
     @Override
     public final QIRNode visit(final BreakNode breakNode) {
-        return new QIRTruffleNode(breakNode.getSourceSection(), "r", QIRInterface::execute, QIRInterface::apply, breakNode.getSourceSection().getCode());
+        return new QIRTruffleNode(breakNode.getSourceSection(), "r", QIRInterface::execute, QIRInterface::apply, breakNode.getSourceSection().getCharacters().toString());
     }
 
     /**
diff --git a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/query/RQIRWrapperNode.java b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/query/RQIRWrapperNode.java
index 31d954defd..82017b57cf 100644
--- a/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/query/RQIRWrapperNode.java
+++ b/com.oracle.truffle.r.nodes/src/com/oracle/truffle/r/nodes/query/RQIRWrapperNode.java
@@ -81,6 +81,6 @@ public final class RQIRWrapperNode extends RSourceSectionNode implements RSyntax
 
     @Override
     public String getSyntaxDebugName() {
-        return getSourceSection().getCode();
+        return getSourceSection().getCharacters().toString();
     }
 }
-- 
GitLab