aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ExecutionEngine/Interpreter
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-04-23 16:57:46 -0700
committerStephen Hines <srhines@google.com>2014-04-24 15:53:16 -0700
commit36b56886974eae4f9c5ebc96befd3e7bfe5de338 (patch)
treee6cfb69fbbd937f450eeb83bfb83b9da3b01275a /lib/ExecutionEngine/Interpreter
parent69a8640022b04415ae9fac62f8ab090601d8f889 (diff)
downloadexternal_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.zip
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.gz
external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.bz2
Update to LLVM 3.5a.
Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
Diffstat (limited to 'lib/ExecutionEngine/Interpreter')
-rw-r--r--lib/ExecutionEngine/Interpreter/Execution.cpp4
-rw-r--r--lib/ExecutionEngine/Interpreter/Interpreter.cpp5
-rw-r--r--lib/ExecutionEngine/Interpreter/Interpreter.h20
-rw-r--r--lib/ExecutionEngine/Interpreter/LLVMBuild.txt2
4 files changed, 17 insertions, 14 deletions
diff --git a/lib/ExecutionEngine/Interpreter/Execution.cpp b/lib/ExecutionEngine/Interpreter/Execution.cpp
index 5de0659..8a80285 100644
--- a/lib/ExecutionEngine/Interpreter/Execution.cpp
+++ b/lib/ExecutionEngine/Interpreter/Execution.cpp
@@ -18,11 +18,11 @@
#include "llvm/CodeGen/IntrinsicLowering.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cmath>
@@ -1120,7 +1120,7 @@ void Interpreter::visitCallSite(CallSite CS) {
callFunction((Function*)GVTOP(SRC), ArgVals);
}
-// auxilary function for shift operations
+// auxiliary function for shift operations
static unsigned getShiftAmount(uint64_t orgShiftAmount,
llvm::APInt valueToShift) {
unsigned valueWidth = valueToShift.getBitWidth();
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.cpp b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
index 9ee9d94..6d4f6f7 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.cpp
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.cpp
@@ -34,9 +34,12 @@ extern "C" void LLVMLinkInInterpreter() { }
///
ExecutionEngine *Interpreter::create(Module *M, std::string* ErrStr) {
// Tell this Module to materialize everything and release the GVMaterializer.
- if (M->MaterializeAllPermanently(ErrStr))
+ if (error_code EC = M->materializeAllPermanently()) {
+ if (ErrStr)
+ *ErrStr = EC.message();
// We got an error, just return 0
return 0;
+ }
return new Interpreter(M);
}
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h
index 98269ef..2e93cae 100644
--- a/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -16,10 +16,10 @@
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/GenericValue.h"
+#include "llvm/IR/CallSite.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
-#include "llvm/InstVisitor.h"
-#include "llvm/Support/CallSite.h"
+#include "llvm/IR/InstVisitor.h"
#include "llvm/Support/DataTypes.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
@@ -112,11 +112,11 @@ public:
/// run - Start execution with the specified function and arguments.
///
- virtual GenericValue runFunction(Function *F,
- const std::vector<GenericValue> &ArgValues);
+ GenericValue runFunction(Function *F,
+ const std::vector<GenericValue> &ArgValues) override;
- virtual void *getPointerToNamedFunction(const std::string &Name,
- bool AbortOnFailure = true) {
+ void *getPointerToNamedFunction(const std::string &Name,
+ bool AbortOnFailure = true) override {
// FIXME: not implemented.
return 0;
}
@@ -124,13 +124,13 @@ public:
/// recompileAndRelinkFunction - For the interpreter, functions are always
/// up-to-date.
///
- virtual void *recompileAndRelinkFunction(Function *F) {
+ void *recompileAndRelinkFunction(Function *F) override {
return getPointerToFunction(F);
}
/// freeMachineCodeForFunction - The interpreter does not generate any code.
///
- void freeMachineCodeForFunction(Function *F) { }
+ void freeMachineCodeForFunction(Function *F) override { }
// Methods used to execute code:
// Place a call on the stack
@@ -212,8 +212,8 @@ private: // Helper functions
//
void SwitchToNewBasicBlock(BasicBlock *Dest, ExecutionContext &SF);
- void *getPointerToFunction(Function *F) { return (void*)F; }
- void *getPointerToBasicBlock(BasicBlock *BB) { return (void*)BB; }
+ void *getPointerToFunction(Function *F) override { return (void*)F; }
+ void *getPointerToBasicBlock(BasicBlock *BB) override { return (void*)BB; }
void initializeExecutionEngine() { }
void initializeExternalFunctions();
diff --git a/lib/ExecutionEngine/Interpreter/LLVMBuild.txt b/lib/ExecutionEngine/Interpreter/LLVMBuild.txt
index 327b320..5af77e5 100644
--- a/lib/ExecutionEngine/Interpreter/LLVMBuild.txt
+++ b/lib/ExecutionEngine/Interpreter/LLVMBuild.txt
@@ -19,4 +19,4 @@
type = Library
name = Interpreter
parent = ExecutionEngine
-required_libraries = CodeGen Core ExecutionEngine Support Target
+required_libraries = CodeGen Core ExecutionEngine Support