aboutsummaryrefslogtreecommitdiffstats
path: root/examples
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 /examples
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 'examples')
-rw-r--r--examples/BrainF/BrainFDriver.cpp4
-rw-r--r--examples/BrainF/CMakeLists.txt9
-rw-r--r--examples/CMakeLists.txt2
-rw-r--r--examples/ExceptionDemo/CMakeLists.txt9
-rw-r--r--examples/ExceptionDemo/ExceptionDemo.cpp9
-rw-r--r--examples/Fibonacci/CMakeLists.txt9
-rw-r--r--examples/Fibonacci/fibonacci.cpp4
-rw-r--r--examples/HowToUseJIT/CMakeLists.txt9
-rw-r--r--examples/Kaleidoscope/Chapter3/CMakeLists.txt5
-rw-r--r--examples/Kaleidoscope/Chapter3/toy.cpp2
-rw-r--r--examples/Kaleidoscope/Chapter4/CMakeLists.txt11
-rw-r--r--examples/Kaleidoscope/Chapter4/toy.cpp5
-rw-r--r--examples/Kaleidoscope/Chapter5/CMakeLists.txt11
-rw-r--r--examples/Kaleidoscope/Chapter5/toy.cpp5
-rw-r--r--examples/Kaleidoscope/Chapter6/CMakeLists.txt11
-rw-r--r--examples/Kaleidoscope/Chapter6/toy.cpp5
-rw-r--r--examples/Kaleidoscope/Chapter7/CMakeLists.txt13
-rw-r--r--examples/Kaleidoscope/Chapter7/toy.cpp5
-rw-r--r--examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp4
-rw-r--r--examples/Kaleidoscope/MCJIT/cached/toy.cpp6
-rw-r--r--examples/Kaleidoscope/MCJIT/complete/toy.cpp6
-rw-r--r--examples/Kaleidoscope/MCJIT/initial/toy.cpp2
-rw-r--r--examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp2
-rw-r--r--examples/Kaleidoscope/MCJIT/lazy/toy.cpp2
-rw-r--r--examples/ModuleMaker/CMakeLists.txt6
-rw-r--r--examples/ParallelJIT/CMakeLists.txt9
-rw-r--r--examples/ParallelJIT/ParallelJIT.cpp3
27 files changed, 128 insertions, 40 deletions
diff --git a/examples/BrainF/BrainFDriver.cpp b/examples/BrainF/BrainFDriver.cpp
index a6a109d..d726464 100644
--- a/examples/BrainF/BrainFDriver.cpp
+++ b/examples/BrainF/BrainFDriver.cpp
@@ -25,11 +25,11 @@
//===--------------------------------------------------------------------===//
#include "BrainF.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/IR/Constants.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/TargetSelect.h"
@@ -108,7 +108,7 @@ int main(int argc, char **argv) {
if (OutputFilename != "-") {
std::string ErrInfo;
out = new raw_fd_ostream(OutputFilename.c_str(), ErrInfo,
- sys::fs::F_Binary);
+ sys::fs::F_None);
}
}
diff --git a/examples/BrainF/CMakeLists.txt b/examples/BrainF/CMakeLists.txt
index 7bec105..025d093 100644
--- a/examples/BrainF/CMakeLists.txt
+++ b/examples/BrainF/CMakeLists.txt
@@ -1,4 +1,11 @@
-set(LLVM_LINK_COMPONENTS jit bitwriter nativecodegen interpreter)
+set(LLVM_LINK_COMPONENTS
+ BitWriter
+ Core
+ ExecutionEngine
+ JIT
+ Support
+ nativecodegen
+ )
add_llvm_example(BrainF
BrainF.cpp
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 54ee6cc..f98c403 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -4,7 +4,7 @@ add_subdirectory(HowToUseJIT)
add_subdirectory(Kaleidoscope)
add_subdirectory(ModuleMaker)
-if( NOT WIN32 )
+if( ( NOT WIN32 ) AND ( NOT "${LLVM_NATIVE_ARCH}" STREQUAL "ARM" ) )
add_subdirectory(ExceptionDemo)
endif()
diff --git a/examples/ExceptionDemo/CMakeLists.txt b/examples/ExceptionDemo/CMakeLists.txt
index ea818fa..5324acd 100644
--- a/examples/ExceptionDemo/CMakeLists.txt
+++ b/examples/ExceptionDemo/CMakeLists.txt
@@ -1,4 +1,11 @@
-set(LLVM_LINK_COMPONENTS jit mcjit nativecodegen)
+set(LLVM_LINK_COMPONENTS
+ Core
+ ExecutionEngine
+ MCJIT
+ Support
+ nativecodegen
+ )
+
set(LLVM_REQUIRES_EH 1)
add_llvm_example(ExceptionDemo
diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp
index d6954e8..24e538c 100644
--- a/examples/ExceptionDemo/ExceptionDemo.cpp
+++ b/examples/ExceptionDemo/ExceptionDemo.cpp
@@ -48,7 +48,7 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Analysis/Verifier.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
#include "llvm/IR/DataLayout.h"
@@ -915,7 +915,7 @@ void generateStringPrint(llvm::LLVMContext &context,
new llvm::GlobalVariable(module,
stringConstant->getType(),
true,
- llvm::GlobalValue::LinkerPrivateLinkage,
+ llvm::GlobalValue::PrivateLinkage,
stringConstant,
"");
}
@@ -959,7 +959,7 @@ void generateIntegerPrint(llvm::LLVMContext &context,
new llvm::GlobalVariable(module,
stringConstant->getType(),
true,
- llvm::GlobalValue::LinkerPrivateLinkage,
+ llvm::GlobalValue::PrivateLinkage,
stringConstant,
"");
}
@@ -1976,7 +1976,8 @@ int main(int argc, char *argv[]) {
// Set up the optimizer pipeline.
// Start with registering info about how the
// target lays out data structures.
- fpm.add(new llvm::DataLayout(*executionEngine->getDataLayout()));
+ module->setDataLayout(executionEngine->getDataLayout());
+ fpm.add(new llvm::DataLayoutPass(module));
// Optimizations turned on
#ifdef ADD_OPT_PASSES
diff --git a/examples/Fibonacci/CMakeLists.txt b/examples/Fibonacci/CMakeLists.txt
index 6937612..724a0f6 100644
--- a/examples/Fibonacci/CMakeLists.txt
+++ b/examples/Fibonacci/CMakeLists.txt
@@ -1,4 +1,11 @@
-set(LLVM_LINK_COMPONENTS jit interpreter nativecodegen)
+set(LLVM_LINK_COMPONENTS
+ Core
+ ExecutionEngine
+ Interpreter
+ JIT
+ Support
+ nativecodegen
+ )
add_llvm_example(Fibonacci
fibonacci.cpp
diff --git a/examples/Fibonacci/fibonacci.cpp b/examples/Fibonacci/fibonacci.cpp
index 8cbf7d1..ba8e953 100644
--- a/examples/Fibonacci/fibonacci.cpp
+++ b/examples/Fibonacci/fibonacci.cpp
@@ -23,7 +23,7 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Analysis/Verifier.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/ExecutionEngine/GenericValue.h"
#include "llvm/ExecutionEngine/Interpreter.h"
#include "llvm/ExecutionEngine/JIT.h"
@@ -96,7 +96,7 @@ int main(int argc, char **argv) {
LLVMContext Context;
// Create some module to put our function into it.
- OwningPtr<Module> M(new Module("test", Context));
+ std::unique_ptr<Module> M(new Module("test", Context));
// We are about to create the "fib" function:
Function *FibF = CreateFibFunction(M.get(), Context);
diff --git a/examples/HowToUseJIT/CMakeLists.txt b/examples/HowToUseJIT/CMakeLists.txt
index 428b53f..88aed02 100644
--- a/examples/HowToUseJIT/CMakeLists.txt
+++ b/examples/HowToUseJIT/CMakeLists.txt
@@ -1,4 +1,11 @@
-set(LLVM_LINK_COMPONENTS jit interpreter nativecodegen)
+set(LLVM_LINK_COMPONENTS
+ Core
+ ExecutionEngine
+ Interpreter
+ JIT
+ Support
+ nativecodegen
+ )
add_llvm_example(HowToUseJIT
HowToUseJIT.cpp
diff --git a/examples/Kaleidoscope/Chapter3/CMakeLists.txt b/examples/Kaleidoscope/Chapter3/CMakeLists.txt
index 1af8db0..a98d7df 100644
--- a/examples/Kaleidoscope/Chapter3/CMakeLists.txt
+++ b/examples/Kaleidoscope/Chapter3/CMakeLists.txt
@@ -1,4 +1,7 @@
-set(LLVM_LINK_COMPONENTS core)
+set(LLVM_LINK_COMPONENTS
+ Core
+ Support
+ )
add_llvm_example(Kaleidoscope-Ch3
toy.cpp
diff --git a/examples/Kaleidoscope/Chapter3/toy.cpp b/examples/Kaleidoscope/Chapter3/toy.cpp
index a7b60ba..04a1e1a 100644
--- a/examples/Kaleidoscope/Chapter3/toy.cpp
+++ b/examples/Kaleidoscope/Chapter3/toy.cpp
@@ -1,4 +1,4 @@
-#include "llvm/Analysis/Verifier.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
diff --git a/examples/Kaleidoscope/Chapter4/CMakeLists.txt b/examples/Kaleidoscope/Chapter4/CMakeLists.txt
index 0d1ac53..72a9f05 100644
--- a/examples/Kaleidoscope/Chapter4/CMakeLists.txt
+++ b/examples/Kaleidoscope/Chapter4/CMakeLists.txt
@@ -1,4 +1,13 @@
-set(LLVM_LINK_COMPONENTS core jit interpreter native)
+set(LLVM_LINK_COMPONENTS
+ Analysis
+ Core
+ ExecutionEngine
+ InstCombine
+ JIT
+ ScalarOpts
+ Support
+ nativecodegen
+ )
add_llvm_example(Kaleidoscope-Ch4
toy.cpp
diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp
index 27c3f4f..a8f5942 100644
--- a/examples/Kaleidoscope/Chapter4/toy.cpp
+++ b/examples/Kaleidoscope/Chapter4/toy.cpp
@@ -1,5 +1,4 @@
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/IR/DataLayout.h"
@@ -7,6 +6,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -586,7 +586,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
- OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
+ TheModule->setDataLayout(TheExecutionEngine->getDataLayout());
+ OurFPM.add(new DataLayoutPass(TheModule));
// Provide basic AliasAnalysis support for GVN.
OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
diff --git a/examples/Kaleidoscope/Chapter5/CMakeLists.txt b/examples/Kaleidoscope/Chapter5/CMakeLists.txt
index 2d75ad3..c7d0276 100644
--- a/examples/Kaleidoscope/Chapter5/CMakeLists.txt
+++ b/examples/Kaleidoscope/Chapter5/CMakeLists.txt
@@ -1,4 +1,13 @@
-set(LLVM_LINK_COMPONENTS core jit interpreter native)
+set(LLVM_LINK_COMPONENTS
+ Analysis
+ Core
+ ExecutionEngine
+ InstCombine
+ JIT
+ ScalarOpts
+ Support
+ nativecodegen
+ )
add_llvm_example(Kaleidoscope-Ch5
toy.cpp
diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp
index fe4cdfe..a31b5b4 100644
--- a/examples/Kaleidoscope/Chapter5/toy.cpp
+++ b/examples/Kaleidoscope/Chapter5/toy.cpp
@@ -1,5 +1,4 @@
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/IR/DataLayout.h"
@@ -7,6 +6,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -831,7 +831,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
- OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
+ TheModule->setDataLayout(TheExecutionEngine->getDataLayout());
+ OurFPM.add(new DataLayoutPass(TheModule));
// Provide basic AliasAnalysis support for GVN.
OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
diff --git a/examples/Kaleidoscope/Chapter6/CMakeLists.txt b/examples/Kaleidoscope/Chapter6/CMakeLists.txt
index 2e15a5f..669c7eb 100644
--- a/examples/Kaleidoscope/Chapter6/CMakeLists.txt
+++ b/examples/Kaleidoscope/Chapter6/CMakeLists.txt
@@ -1,4 +1,13 @@
-set(LLVM_LINK_COMPONENTS core jit interpreter native)
+set(LLVM_LINK_COMPONENTS
+ Analysis
+ Core
+ ExecutionEngine
+ InstCombine
+ JIT
+ ScalarOpts
+ Support
+ nativecodegen
+ )
add_llvm_example(Kaleidoscope-Ch6
toy.cpp
diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp
index b7b347d..5a3bd2e 100644
--- a/examples/Kaleidoscope/Chapter6/toy.cpp
+++ b/examples/Kaleidoscope/Chapter6/toy.cpp
@@ -1,5 +1,4 @@
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/IR/DataLayout.h"
@@ -7,6 +6,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -949,7 +949,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
- OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
+ TheModule->setDataLayout(TheExecutionEngine->getDataLayout());
+ OurFPM.add(new DataLayoutPass(TheModule));
// Provide basic AliasAnalysis support for GVN.
OurFPM.add(createBasicAliasAnalysisPass());
// Do simple "peephole" optimizations and bit-twiddling optzns.
diff --git a/examples/Kaleidoscope/Chapter7/CMakeLists.txt b/examples/Kaleidoscope/Chapter7/CMakeLists.txt
index da38398..0a0c8e7 100644
--- a/examples/Kaleidoscope/Chapter7/CMakeLists.txt
+++ b/examples/Kaleidoscope/Chapter7/CMakeLists.txt
@@ -1,4 +1,15 @@
-set(LLVM_LINK_COMPONENTS core jit interpreter native)
+set(LLVM_LINK_COMPONENTS
+ Analysis
+ Core
+ ExecutionEngine
+ InstCombine
+ JIT
+ ScalarOpts
+ Support
+ TransformUtils
+ nativecodegen
+ )
+
set(LLVM_REQUIRES_RTTI 1)
add_llvm_example(Kaleidoscope-Ch7
diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp
index 5c66f5c..c2c337c 100644
--- a/examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/examples/Kaleidoscope/Chapter7/toy.cpp
@@ -1,5 +1,4 @@
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/IR/DataLayout.h"
@@ -7,6 +6,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
@@ -1113,7 +1113,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
- OurFPM.add(new DataLayout(*TheExecutionEngine->getDataLayout()));
+ TheModule->setDataLayout(TheExecutionEngine->getDataLayout());
+ OurFPM.add(new DataLayoutPass(TheModule));
// Provide basic AliasAnalysis support for GVN.
OurFPM.add(createBasicAliasAnalysisPass());
// Promote allocas to registers.
diff --git a/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp b/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
index 784781b..9466360 100644
--- a/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
+++ b/examples/Kaleidoscope/MCJIT/cached/toy-jit.cpp
@@ -1,7 +1,6 @@
#define MINIMAL_STDERR_OUTPUT
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/IR/DataLayout.h"
@@ -9,12 +8,13 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/PassManager.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/TargetSelect.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include <cctype>
#include <cstdio>
diff --git a/examples/Kaleidoscope/MCJIT/cached/toy.cpp b/examples/Kaleidoscope/MCJIT/cached/toy.cpp
index 5bc49d7..16c548c 100644
--- a/examples/Kaleidoscope/MCJIT/cached/toy.cpp
+++ b/examples/Kaleidoscope/MCJIT/cached/toy.cpp
@@ -1,7 +1,6 @@
#define MINIMAL_STDERR_OUTPUT
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/ObjectCache.h"
@@ -11,14 +10,15 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/PassManager.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/TargetSelect.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include <cctype>
#include <cstdio>
@@ -715,7 +715,7 @@ public:
// This file isn't in our cache
return NULL;
}
- OwningPtr<MemoryBuffer> IRObjectBuffer;
+ std::unique_ptr<MemoryBuffer> IRObjectBuffer;
MemoryBuffer::getFile(IRCacheFile.c_str(), IRObjectBuffer, -1, false);
// MCJIT will want to write into this buffer, and we don't want that
// because the file has probably just been mmapped. Instead we make
diff --git a/examples/Kaleidoscope/MCJIT/complete/toy.cpp b/examples/Kaleidoscope/MCJIT/complete/toy.cpp
index 1f804d5..10e7ada 100644
--- a/examples/Kaleidoscope/MCJIT/complete/toy.cpp
+++ b/examples/Kaleidoscope/MCJIT/complete/toy.cpp
@@ -1,5 +1,4 @@
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/ExecutionEngine/MCJIT.h"
@@ -10,14 +9,15 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/IRReader/IRReader.h"
#include "llvm/PassManager.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/TargetSelect.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Scalar.h"
#include <cctype>
#include <cstdio>
@@ -739,7 +739,7 @@ public:
// This file isn't in our cache
return NULL;
}
- OwningPtr<MemoryBuffer> IRObjectBuffer;
+ std::unique_ptr<MemoryBuffer> IRObjectBuffer;
MemoryBuffer::getFile(IRCacheFile.c_str(), IRObjectBuffer, -1, false);
// MCJIT will want to write into this buffer, and we don't want that
// because the file has probably just been mmapped. Instead we make
diff --git a/examples/Kaleidoscope/MCJIT/initial/toy.cpp b/examples/Kaleidoscope/MCJIT/initial/toy.cpp
index 7e2f7df..4c47113 100644
--- a/examples/Kaleidoscope/MCJIT/initial/toy.cpp
+++ b/examples/Kaleidoscope/MCJIT/initial/toy.cpp
@@ -1,5 +1,4 @@
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
@@ -8,6 +7,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
diff --git a/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp b/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
index c3d88c8..2d540dd 100644
--- a/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
+++ b/examples/Kaleidoscope/MCJIT/lazy/toy-jit.cpp
@@ -1,7 +1,6 @@
#define MINIMAL_STDERR_OUTPUT
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JIT.h"
#include "llvm/IR/DataLayout.h"
@@ -9,6 +8,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
diff --git a/examples/Kaleidoscope/MCJIT/lazy/toy.cpp b/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
index 189331c..ff88e23 100644
--- a/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
+++ b/examples/Kaleidoscope/MCJIT/lazy/toy.cpp
@@ -1,7 +1,6 @@
#define MINIMAL_STDERR_OUTPUT
#include "llvm/Analysis/Passes.h"
-#include "llvm/Analysis/Verifier.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/MCJIT.h"
#include "llvm/ExecutionEngine/SectionMemoryManager.h"
@@ -10,6 +9,7 @@
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
+#include "llvm/IR/Verifier.h"
#include "llvm/PassManager.h"
#include "llvm/Support/TargetSelect.h"
#include "llvm/Transforms/Scalar.h"
diff --git a/examples/ModuleMaker/CMakeLists.txt b/examples/ModuleMaker/CMakeLists.txt
index 81e9115..a73909a 100644
--- a/examples/ModuleMaker/CMakeLists.txt
+++ b/examples/ModuleMaker/CMakeLists.txt
@@ -1,4 +1,8 @@
-set(LLVM_LINK_COMPONENTS bitwriter)
+set(LLVM_LINK_COMPONENTS
+ BitWriter
+ Core
+ Support
+ )
add_llvm_example(ModuleMaker
ModuleMaker.cpp
diff --git a/examples/ParallelJIT/CMakeLists.txt b/examples/ParallelJIT/CMakeLists.txt
index fbdc6e5..8673917 100644
--- a/examples/ParallelJIT/CMakeLists.txt
+++ b/examples/ParallelJIT/CMakeLists.txt
@@ -1,4 +1,11 @@
-set(LLVM_LINK_COMPONENTS jit interpreter nativecodegen)
+set(LLVM_LINK_COMPONENTS
+ Core
+ ExecutionEngine
+ Interpreter
+ JIT
+ Support
+ nativecodegen
+ )
add_llvm_example(ParallelJIT
ParallelJIT.cpp
diff --git a/examples/ParallelJIT/ParallelJIT.cpp b/examples/ParallelJIT/ParallelJIT.cpp
index 64a3886..2aa63d9 100644
--- a/examples/ParallelJIT/ParallelJIT.cpp
+++ b/examples/ParallelJIT/ParallelJIT.cpp
@@ -139,6 +139,7 @@ public:
~WaitForThreads()
{
int result = pthread_cond_destroy( &condition );
+ (void)result;
assert( result == 0 );
result = pthread_mutex_destroy( &mutex );
@@ -149,6 +150,7 @@ public:
void block()
{
int result = pthread_mutex_lock( &mutex );
+ (void)result;
assert( result == 0 );
n ++;
//~ std::cout << "block() n " << n << " waitFor " << waitFor << std::endl;
@@ -178,6 +180,7 @@ public:
void releaseThreads( size_t num )
{
int result = pthread_mutex_lock( &mutex );
+ (void)result;
assert( result == 0 );
if ( n >= num ) {