diff -ur /home/kjetil/faust2/benchmark/Makefile ./benchmark/Makefile
--- /home/kjetil/faust2/benchmark/Makefile	2016-06-06 16:26:32.000000000 +0200
+++ ./benchmark/Makefile	2016-06-07 13:33:52.105375023 +0200
@@ -48,6 +48,12 @@
 LLC = /opt/local/libexec/llvm-3.7/bin/llc
 endif
 
+ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.8.0))
+LLVM_VERSION  = LLVM_38
+CXX = /opt/local/libexec/llvm-3.8/bin/clang++
+LLC = /opt/local/libexec/llvm-3.8/bin/llc
+endif
+
 ifeq ($(system), Darwin)
 #MYGCCFLAGS := '-O3 -mfpmath=sse -msse -msse2 -msse3 -ffast-math '
 #MYGCCFLAGS := '-O3 -mfpmath=sse -msse -msse2 -msse3 -ffast-math -fvectorize -fslp-vectorize'
diff -ur /home/kjetil/faust2/compiler/generator/llvm/clang_code_container.cpp ./compiler/generator/llvm/clang_code_container.cpp
--- /home/kjetil/faust2/compiler/generator/llvm/clang_code_container.cpp	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/generator/llvm/clang_code_container.cpp	2016-06-07 13:25:26.622262137 +0200
@@ -35,7 +35,7 @@
 #include <clang/Frontend/TextDiagnosticPrinter.h>
 
 #include <llvm/Bitcode/ReaderWriter.h>
-#if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
 #include <llvm/IR/Module.h>
 #else
 #include <llvm/Module.h>
@@ -45,7 +45,7 @@
 #include <llvm/Support/TargetSelect.h>
 #include <llvm/Support/raw_ostream.h>
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
 #include <llvm/Support/FileSystem.h>
 #define sysfs_binary_flag sys::fs::F_None
 #elif defined(LLVM_34)
@@ -102,7 +102,7 @@
     fCompiler->compileMultiSignal(signals);
     fContainer->produceClass();
     
-#if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     // Compile it with 'clang'
     IntrusiveRefCntPtr<DiagnosticOptions> DiagOpts = new DiagnosticOptions();
     TextDiagnosticPrinter* DiagClient = new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts);
diff -ur /home/kjetil/faust2/compiler/generator/llvm/llvm_code_container.cpp ./compiler/generator/llvm/llvm_code_container.cpp
--- /home/kjetil/faust2/compiler/generator/llvm/llvm_code_container.cpp	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/generator/llvm/llvm_code_container.cpp	2016-06-07 13:26:11.944079284 +0200
@@ -48,12 +48,16 @@
     fResult->fModule->setDataLayout("e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128");
     fBuilder = new IRBuilder<>(getContext());
     
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37))    
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38))    
     // Set "-fast-math"
     FastMathFlags FMF;
     FMF.setUnsafeAlgebra();
+#if defined(LLVM_38)
+    fBuilder->setFastMathFlags(FMF);
+#else
     fBuilder->SetFastMathFlags(FMF);
 #endif
+#endif
     
     fAllocaBuilder = new IRBuilder<>(getContext());
     
@@ -71,12 +75,16 @@
     fResult = result;
     fBuilder = new IRBuilder<>(getContext());
     
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37))    
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38))    
     // Set "-fast-math"
     FastMathFlags FMF;
     FMF.setUnsafeAlgebra();
+#if defined(LLVM_38)
+    fBuilder->setFastMathFlags(FMF);
+#else
     fBuilder->SetFastMathFlags(FMF);
 #endif
+#endif
     
     fAllocaBuilder = new IRBuilder<>(getContext());
 }
@@ -143,11 +151,11 @@
     llvm_fill->setCallingConv(CallingConv::C);
 
     Function::arg_iterator llvm_fill_args_it = llvm_fill->arg_begin();
-    Value* arg1 = llvm_fill_args_it++;
+    Value* arg1 = GET_ITERATOR(llvm_fill_args_it++);
     arg1->setName("dsp");
-    Value* arg2 = llvm_fill_args_it++;
+    Value* arg2 = GET_ITERATOR(llvm_fill_args_it++);
     arg2->setName(counter);
-    Value* arg4 = llvm_fill_args_it++;
+    Value* arg4 = GET_ITERATOR(llvm_fill_args_it++);
     arg4->setName("output");
 
     //llvm_fill->dump();
@@ -188,7 +196,7 @@
     Function* llvm_compute = Function::Create(llvm_compute_type, GlobalValue::ExternalLinkage, "compute" + fKlassName, fResult->fModule);
     llvm_compute->setCallingConv(CallingConv::C);
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     llvm_compute->setDoesNotAlias(3U);
     llvm_compute->setDoesNotAlias(4U);
 #elif defined(LLVM_32) 
@@ -208,13 +216,13 @@
 #endif
 
     Function::arg_iterator llvm_compute_args_it = llvm_compute->arg_begin();
-    Value* arg1 = llvm_compute_args_it++;
+    Value* arg1 = GET_ITERATOR(llvm_compute_args_it++);
     arg1->setName("dsp");
-    Value* arg2 = llvm_compute_args_it++;
+    Value* arg2 = GET_ITERATOR(llvm_compute_args_it++);
     arg2->setName(counter);
-    Value* arg3 = llvm_compute_args_it++;
+    Value* arg3 = GET_ITERATOR(llvm_compute_args_it++);
     arg3->setName("inputs");
-    Value* arg4 = llvm_compute_args_it++;
+    Value* arg4 = GET_ITERATOR(llvm_compute_args_it++);
     arg4->setName("outputs");
 
     // Add a first block
@@ -253,12 +261,12 @@
     sr_fun->setCallingConv(CallingConv::C);
 
     Function::arg_iterator llvm_SR_args_it = sr_fun->arg_begin();
-    Value* dsp = llvm_SR_args_it++;
+    Value* dsp = GET_ITERATOR(llvm_SR_args_it++);
     dsp->setName("dsp");
 
     BasicBlock* block = BasicBlock::Create(getContext(), "entry_block", sr_fun);
     fBuilder->SetInsertPoint(block);
-#if defined(LLVM_37)
+#if defined(LLVM_37) || defined(LLVM_38)
     Value* zone_ptr = fBuilder->CreateStructGEP(nullptr, dsp, field_index);
 #else
     Value* zone_ptr = fBuilder->CreateStructGEP(dsp, field_index);
@@ -295,7 +303,7 @@
     llvm_classInit->setCallingConv(CallingConv::C);
 
     Function::arg_iterator llvm_classInit_args_it = llvm_classInit->arg_begin();
-    Value* sample_freq = llvm_classInit_args_it++;
+    Value* sample_freq = GET_ITERATOR(llvm_classInit_args_it++);
     sample_freq->setName("samplingFreq");
 
     // Add a first block
@@ -330,9 +338,9 @@
     llvm_instanceInit->setCallingConv(CallingConv::C);
 
     Function::arg_iterator llvm_instanceInit_args_it = llvm_instanceInit->arg_begin();
-    Value* dsp = llvm_instanceInit_args_it++;
+    Value* dsp = GET_ITERATOR(llvm_instanceInit_args_it++);
     dsp->setName("dsp");
-    Value* sample_freq = llvm_instanceInit_args_it++;
+    Value* sample_freq = GET_ITERATOR(llvm_instanceInit_args_it++);
     sample_freq->setName("samplingFreq");
 
     // Add a first block
@@ -419,9 +427,9 @@
     llvm_init->setCallingConv(CallingConv::C);
 
     Function::arg_iterator llvm_init_args_it = llvm_init->arg_begin();
-    Value* arg1 = llvm_init_args_it++;
+    Value* arg1 = GET_ITERATOR(llvm_init_args_it++);
     arg1->setName("dsp");
-    Value* arg2 = llvm_init_args_it++;
+    Value* arg2 = GET_ITERATOR(llvm_init_args_it++);
     arg2->setName("samplingFreq");
 
     /// llvm_init block
@@ -459,7 +467,7 @@
 
     // Name arguments
     Function::arg_iterator llvm_metaData_args_it = llvm_metaData->arg_begin();
-    Value* meta = llvm_metaData_args_it++;
+    Value* meta = GET_ITERATOR(llvm_metaData_args_it++);
     meta->setName("m");
 
     BasicBlock* entry_block = BasicBlock::Create(getContext(), "entry_block", llvm_metaData);
@@ -480,12 +488,12 @@
     for (MetaDataSet::iterator i = gGlobal->gMetaDataSet.begin(); i != gGlobal->gMetaDataSet.end(); i++) {
         GlobalVariable* llvm_label1 = 0;
         GlobalVariable* llvm_label2 = 0;
-    #if defined(LLVM_37)
+    #if defined(LLVM_37) || defined(LLVM_38)
         llvm::Type* type_def1;
         llvm::Type* type_def2;
     #endif
         if (i->first != tree("author")) {
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             llvm_label1 = fCodeProducer->addStringConstant(tree2str(i->first), type_def1);
             llvm_label2 = fCodeProducer->addStringConstant(tree2str(*(i->second.begin())), type_def2);
         #else
@@ -494,7 +502,7 @@
         #endif
         } else {
             for (set<Tree>::iterator j = i->second.begin(); j != i->second.end(); j++) {
-            #if defined(LLVM_37)
+            #if defined(LLVM_37) || defined(LLVM_38)
                 if (j == i->second.begin()) {
                     llvm_label1 = fCodeProducer->addStringConstant(tree2str(i->first), type_def1);
                     llvm_label2 = fCodeProducer->addStringConstant(tree2str(*j), type_def2);
@@ -518,7 +526,7 @@
     
         Value* idx2[3];
         idx2[0] = load_meta_ptr;
-    #if defined(LLVM_37)
+    #if defined(LLVM_37) || defined(LLVM_38)
         idx2[1] = fBuilder->CreateConstGEP2_32(type_def1, llvm_label1, 0, 0);
         idx2[2] = fBuilder->CreateConstGEP2_32(type_def2, llvm_label2, 0, 0);
     #else
@@ -545,7 +553,7 @@
     Function* llvm_buildUserInterface = fResult->fModule->getFunction("buildUserInterface" + fKlassName);
 
     // Get the already created init block and insert in it.
-    BasicBlock* entry_block = llvm_buildUserInterface->getBasicBlockList().begin();
+    BasicBlock* entry_block = GET_ITERATOR(llvm_buildUserInterface->getBasicBlockList().begin());
     fBuilder->SetInsertPoint(entry_block);
 }
 
@@ -952,9 +960,9 @@
     llvm_computethread->setCallingConv(CallingConv::C);
 
     Function::arg_iterator llvm_computethread_args_it = llvm_computethread->arg_begin();
-    Value* arg1 = llvm_computethread_args_it++;
+    Value* arg1 = GET_ITERATOR(llvm_computethread_args_it++);
     arg1->setName("dsp");
-    Value* arg2 = llvm_computethread_args_it++;
+    Value* arg2 = GET_ITERATOR(llvm_computethread_args_it++);
     arg2->setName("num_thread");
 
     // Add a first block
@@ -990,9 +998,9 @@
     llvm_computethread->setCallingConv(CallingConv::C);
 
     Function::arg_iterator llvm_computethread_args_it = llvm_computethread->arg_begin();
-    Value* arg1 = llvm_computethread_args_it++;
+    Value* arg1 = GET_ITERATOR(llvm_computethread_args_it++);
     arg1->setName("dsp");
-    Value* arg2 = llvm_computethread_args_it++;
+    Value* arg2 = GET_ITERATOR(llvm_computethread_args_it++);
     arg2->setName("num_thread");
 
     // Add a first block
@@ -1000,7 +1008,7 @@
 
     Function* llvm_computethreadInternal = fResult->fModule->getFunction("computeThread");
     assert(llvm_computethreadInternal);
-#if defined(LLVM_37)
+#if defined(LLVM_37) || defined(LLVM_38)
     Value* fun_args[] = { fBuilder->CreateBitCast(arg1, fStruct_DSP_ptr), arg2 };
     CallInst* call_inst = fBuilder->CreateCall(llvm_computethreadInternal, fun_args);
 #else
diff -ur /home/kjetil/faust2/compiler/generator/llvm/llvm_code_container.hh ./compiler/generator/llvm/llvm_code_container.hh
--- /home/kjetil/faust2/compiler/generator/llvm/llvm_code_container.hh	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/generator/llvm/llvm_code_container.hh	2016-06-07 13:26:21.485251308 +0200
@@ -28,7 +28,7 @@
 #include "omp_code_container.hh"
 #include "wss_code_container.hh"
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/Support/FileSystem.h>
     #define sysfs_binary_flag sys::fs::F_None
 #elif defined(LLVM_34)
@@ -37,7 +37,7 @@
     #define sysfs_binary_flag raw_fd_ostream::F_Binary
 #endif
 
-#if defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #define STREAM_ERROR std::error_code
 #else
     #define STREAM_ERROR std::string
diff -ur /home/kjetil/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp ./compiler/generator/llvm/llvm_dsp_aux.cpp
--- /home/kjetil/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/generator/llvm/llvm_dsp_aux.cpp	2016-06-07 13:42:04.065242103 +0200
@@ -42,13 +42,13 @@
 #include "exception.hh"
 #include "rn_base64.h"
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <system_error>
 #else
     #include <llvm/Support/system_error.h>
 #endif
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/Module.h>
     #include <llvm/IR/LLVMContext.h>
     #include <llvm/IRReader/IRReader.h>
@@ -66,7 +66,7 @@
     #include <llvm/Support/IRReader.h>
 #endif
 
-#if defined(LLVM_37)
+#if defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/Analysis/TargetLibraryInfo.h>
     #include <llvm/Analysis/TargetTransformInfo.h>
     #include <llvm/IR/PassManager.h>
@@ -86,19 +86,19 @@
  */
 #if defined(LLVM_32)
     #include <llvm/DataLayout.h>
-#elif !defined(LLVM_33) && !defined(LLVM_34) && !defined(LLVM_35) && !defined(LLVM_36) && !defined(LLVM_37)
+#elif !defined(LLVM_33) && !defined(LLVM_34) && !defined(LLVM_35) && !defined(LLVM_36) && !defined(LLVM_37) && !defined(LLVM_38)
     #ifndef _WIN32
         #include <llvm/Target/TargetData.h>
     #endif
 #endif
 
-#if defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/ExecutionEngine/MCJIT.h>
 #else
     #include <llvm/ExecutionEngine/JIT.h>
 #endif
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/Verifier.h>
 #else
     #include <llvm/Analysis/Verifier.h>
@@ -108,7 +108,7 @@
 #include <llvm/Transforms/IPO.h>
 #include <llvm/Transforms/Scalar.h>
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/LegacyPassNameParser.h>
     #include <llvm/Linker/Linker.h>
 #else
@@ -119,7 +119,7 @@
 #include <llvm/Support/Host.h>
 #include <llvm/Support/ManagedStatic.h>
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/IRPrintingPasses.h>
     #define llvmcreatePrintModulePass(out) createPrintModulePass(out)
 #else
@@ -130,17 +130,17 @@
 #include <llvm/Transforms/IPO/PassManagerBuilder.h>
 #include <llvm/Support/Threading.h>
 
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     #include "llvm/ExecutionEngine/ObjectCache.h"
 #endif
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #define OwningPtr std::unique_ptr
 #endif
 
 #include <llvm/Support/TargetSelect.h>
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/Support/FileSystem.h>
     #define sysfs_binary_flag sys::fs::F_None
 #elif defined(LLVM_34)
@@ -149,13 +149,13 @@
     #define sysfs_binary_flag raw_fd_ostream::F_Binary
 #endif
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #define GET_CPU_NAME llvm::sys::getHostCPUName().str()
 #else
     #define GET_CPU_NAME llvm::sys::getHostCPUName()
 #endif
 
-#if defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #define STREAM_ERROR std::error_code
     #define MEMORY_BUFFER MemoryBufferRef
     #define MEMORY_BUFFER_GET(buffer) (buffer.getBuffer())
@@ -169,7 +169,7 @@
     #define MEMORY_BUFFER_CREATE(stringref) (MemoryBuffer::getMemBuffer(stringref))
 #endif
 
-#if defined(LLVM_34) || defined(LLVM_35)  || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_34) || defined(LLVM_35)  || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #define MAX_OPT_LEVEL 5
 #else 
     #define MAX_OPT_LEVEL 4
@@ -264,7 +264,7 @@
 };
 #endif
 
-#if defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
 
 // Workaround for iOS compiled LLVM 3.6 missing symbol
 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000
@@ -318,7 +318,7 @@
 }
 #endif
 
-#if defined(LLVM_37)
+#if defined(LLVM_37) || defined(LLVM_38)
 static Module* ParseBitcodeFile(MEMORY_BUFFER Buffer,
                                 LLVMContext& Context,
                                 string* ErrMsg)
@@ -336,7 +336,7 @@
 
 void* llvm_dsp_factory::loadOptimize(const string& function)
 {
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     void* fun = (void*)fJIT->getFunctionAddress(function);
     if (fun) {
         return fun;
@@ -416,7 +416,7 @@
 
 bool llvm_dsp_factory::crossCompile(const std::string& target)
 {
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     delete fObjectCache;
     fObjectCache = new FaustObjectCache();
     setTarget(target);
@@ -429,7 +429,7 @@
 
 std::string llvm_dsp_factory::writeDSPFactoryToMachineAux(const std::string& target)
 { 
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     if (target == "" || target == getTarget()) {
         return fObjectCache->getMachineCode();
     } else {
@@ -460,7 +460,7 @@
     out.flush();
 }
 
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
 llvm_dsp_factory::llvm_dsp_factory(const string& sha_key, const string& machine_code, const string& target)
 {
     init("MachineDSP", "");
@@ -487,12 +487,12 @@
     fResult->fModule = module;
     fResult->fContext = context;
     
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     fObjectCache = NULL;
 #endif
 }
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
 void llvm_dsp_factory::LLVMFatalErrorHandler(const char* reason)
 {
     throw faustexception(reason);
@@ -512,10 +512,10 @@
     if (llvm_dsp_factory::gInstance++ == 0) {
         
         // Install a LLVM error handler
-    #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+    #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
         LLVMInstallFatalErrorHandler(llvm_dsp_factory::LLVMFatalErrorHandler);
     #endif
-    #if (!defined(LLVM_35) && !defined(LLVM_36) && !defined(LLVM_37)) // In LLVM 3.5 this is gone.
+    #if (!defined(LLVM_35) && !defined(LLVM_36) && !defined(LLVM_37) && !defined(LLVM_38)) // In LLVM 3.5 this is gone.
         if (!llvm_start_multithreaded()) {
             printf("llvm_start_multithreaded error...\n");
         }
@@ -527,7 +527,7 @@
     fExpandedDSP = expanded_dsp_content;
     fSHAKey = sha_key;
     fTarget = (target == "") ? fTarget = (llvm::sys::getDefaultTargetTriple() + ":" + GET_CPU_NAME) : target;  
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     fObjectCache = NULL;
 #endif
     
@@ -581,7 +581,7 @@
     return -1;
 }
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
 /// AddOptimizationPasses - This routine adds optimization passes
 /// based on selected optimization level, OptLevel. This routine
 /// duplicates llvm-gcc behaviour.
@@ -644,22 +644,22 @@
     InitializeNativeTargetAsmParser();
     
     // For ObjectCache to work...
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     LLVMLinkInMCJIT();
 #endif
     
     // Restoring from machine code
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     if (fObjectCache) {
     
         // JIT
-    #if defined(LLVM_36) || defined(LLVM_37)
+    #if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
         EngineBuilder builder(unique_ptr<Module>(fResult->fModule));
     #else
         EngineBuilder builder(fResult->fModule);
     #endif
         builder.setEngineKind(EngineKind::JIT);
-    #if !defined(LLVM_36) && !defined(LLVM_37)
+    #if !defined(LLVM_36) && !defined(LLVM_37) && !defined(LLVM_38)
         builder.setUseMCJIT(true);
     #endif
         TargetMachine* tm = builder.selectTarget();
@@ -684,13 +684,15 @@
         initializeVectorization(Registry);
         initializeIPO(Registry);
         initializeAnalysis(Registry);
+#if !defined(LLVM_38)
         initializeIPA(Registry);
+#endif
         initializeTransformUtils(Registry);
         initializeInstCombine(Registry);
         initializeInstrumentation(Registry);
         initializeTarget(Registry);
        
-    #if defined(LLVM_36) || defined(LLVM_37)
+    #if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
         EngineBuilder builder(unique_ptr<Module>(fResult->fModule));
     #else
         EngineBuilder builder(fResult->fModule);
@@ -705,7 +707,7 @@
         // MCJIT does not work correctly (incorrect float numbers ?) when used with dynamic libLLVM
     #if (defined(LLVM_34) || defined(LLVM_35)) && !defined(_MSC_VER)
         builder.setUseMCJIT(true);
-    #elif !defined(LLVM_36) && !defined(LLVM_37)
+    #elif !defined(LLVM_36) && !defined(LLVM_37) && !defined(LLVM_38)
         builder.setUseMCJIT(false);
     #endif
     
@@ -761,7 +763,7 @@
             PASS_MANAGER pm;
             FUNCTION_PASS_MANAGER fpm(fResult->fModule);
             
-        #if defined(LLVM_37) // Code taken from opt.cpp
+        #if defined(LLVM_37) || defined(LLVM_38) // Code taken from opt.cpp
             TargetLibraryInfoImpl TLII(Triple(fResult->fModule->getTargetTriple()));
             pm.add(new TargetLibraryInfoWrapperPass(TLII));
         #else
@@ -769,8 +771,10 @@
             TargetLibraryInfo* tli = new TargetLibraryInfo(Triple(fResult->fModule->getTargetTriple()));
             pm.add(tli);
         #endif
-            
-        #if defined(LLVM_37) // Code taken from opt.cpp
+
+        #if defined(LLVM_38)
+            fResult->fModule->setDataLayout(fJIT->getDataLayout());
+        #elif defined(LLVM_37) // Code taken from opt.cpp
             fResult->fModule->setDataLayout(*fJIT->getDataLayout());
         #elif defined(LLVM_35) || defined(LLVM_36)
             // LLVM 3.5 doesn't need a separate pass for the data
@@ -782,7 +786,7 @@
         #endif
           
             // Add internal analysis passes from the target machine (mandatory for vectorization to work)
-        #if defined(LLVM_37) // Code taken from opt.cpp
+        #if defined(LLVM_37) || defined(LLVM_38) // Code taken from opt.cpp
             pm.add(createTargetTransformInfoWrapperPass(tm->getTargetIRAnalysis()));
         #else
             tm->addAnalysisPasses(pm);
@@ -806,7 +810,7 @@
             pm.add(createVerifierPass());
             
             if ((debug_var != "") && (debug_var.find("FAUST_LLVM4") != string::npos)) {
-            #if defined(LLVM_37)
+            #if defined(LLVM_37) || defined(LLVM_38)
                 // TODO
             #else
                 tm->addPassesToEmitFile(pm, fouts(), TargetMachine::CGFT_AssemblyFile, true);
@@ -821,7 +825,7 @@
             }
         }
         
-    #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+    #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
         fObjectCache = new FaustObjectCache();
         fJIT->setObjectCache(fObjectCache);
     }
@@ -970,7 +974,7 @@
 
 llvm_dsp_factory::~llvm_dsp_factory()
 {
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     delete fObjectCache;
 #endif
     if (fJIT) {
@@ -985,10 +989,10 @@
     }
     
     if (--llvm_dsp_factory::gInstance == 0) {
-    #if  (!defined(LLVM_35)) && (!defined(LLVM_36)) && (!defined(LLVM_37)) // In LLVM 3.5 this is gone.
+#if  (!defined(LLVM_35)) && (!defined(LLVM_36)) && (!defined(LLVM_37)) && (!defined(LLVM_38)) // In LLVM 3.5 this is gone.
         llvm_stop_multithreaded();
     #endif
-    #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+    #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
         LLVMResetFatalErrorHandler();
     #endif
     }
@@ -1090,7 +1094,7 @@
 EXPORT Module* load_single_module(const string filename, LLVMContext* context)
 {
     SMDiagnostic err;
-#if defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     Module* module = parseIRFile(filename, err, *context).get();
 #else
     Module* module = ParseIRFile(filename, err, *context);
@@ -1107,8 +1111,12 @@
 EXPORT bool link_modules(Module* dst, Module* src, char* error_msg)
 {
     bool res = false;
-    
-#if defined(LLVM_36) || defined(LLVM_37)
+
+#if defined(LLVM_38)
+    if (Linker::linkModules(*dst, std::unique_ptr<Module>(src))) { // Don't know what I'm doing here. Could Linker::linkModules try to free the src pointer? -Kjetil
+        snprintf(error_msg, 256, "cannot link module");
+        
+#elif defined(LLVM_36) || defined(LLVM_37)
     if (Linker::LinkModules(dst, src)) {
         snprintf(error_msg, 256, "cannot link module");
 #else
@@ -1394,7 +1402,7 @@
 {
     TLock lock(gDSPFactoriesLock);
   
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     ErrorOr<OwningPtr<MemoryBuffer>> buffer = MemoryBuffer::getFileOrSTDIN(bit_code_path);
     if (std::error_code ec = buffer.getError()) {
         printf("readDSPFactoryFromBitcodeFile failed : %s\n", ec.message().c_str());
@@ -1438,7 +1446,7 @@
         setlocale(LC_ALL, "C");
         LLVMContext* context = new LLVMContext();
         SMDiagnostic err;
-    #if defined(LLVM_36) || defined(LLVM_37)
+    #if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
         Module* module = parseIR(buffer, err, *context).get();  // ParseIR takes ownership of the given buffer, so don't delete it
     #else
         Module* module = ParseIR(buffer, err, *context);        // ParseIR takes ownership of the given buffer, so don't delete it
@@ -1475,7 +1483,7 @@
 {
     TLock lock(gDSPFactoriesLock);
  
- #if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+ #if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     ErrorOr<OwningPtr<MemoryBuffer>> buffer = MemoryBuffer::getFileOrSTDIN(ir_code_path);
     if (std::error_code ec = buffer.getError()) {
         printf("readDSPFactoryFromIRFile failed : %s\n", ec.message().c_str());
@@ -1503,7 +1511,7 @@
     }
 }
 
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
     
 static llvm_dsp_factory* readDSPFactoryFromMachineAux(MEMORY_BUFFER buffer, const std::string& target)
 {
@@ -1547,7 +1555,7 @@
 {
     TLock lock(gDSPFactoriesLock);
     
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     ErrorOr<OwningPtr<MemoryBuffer>> buffer = MemoryBuffer::getFileOrSTDIN(machine_code_path);
     if (std::error_code ec = buffer.getError()) {
         printf("readDSPFactoryFromMachineFile failed : %s\n", ec.message().c_str());
@@ -1841,7 +1849,7 @@
     }
 }
 
-#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+#if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
 EXPORT llvm_dsp_factory* readCDSPFactoryFromMachine(const char* machine_code, const char* target)
 {
     return readDSPFactoryFromMachine(machine_code, target);
diff -ur /home/kjetil/faust2/compiler/generator/llvm/llvm_dsp_aux.hh ./compiler/generator/llvm/llvm_dsp_aux.hh
--- /home/kjetil/faust2/compiler/generator/llvm/llvm_dsp_aux.hh	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/generator/llvm/llvm_dsp_aux.hh	2016-06-07 13:30:44.121986269 +0200
@@ -67,7 +67,7 @@
     
         ExecutionEngine* fJIT;
 
-    #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+    #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
         FaustObjectCache* fObjectCache;
     #endif
         LLVMResult* fResult;
@@ -104,7 +104,7 @@
         
         bool crossCompile(const std::string& target);
       
-    #if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+    #if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
         static void LLVMFatalErrorHandler(const char* reason);
     #endif
     
@@ -120,7 +120,7 @@
               
         llvm_dsp_factory(const string& sha_key, Module* module, LLVMContext* context, const string& target, int opt_level = 0);
         
-    #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)) && !defined(_MSC_VER)
+    #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)) && !defined(_MSC_VER)
         llvm_dsp_factory(const string& sha_key, const string& machine_code, const string& target);
     #endif
       
diff -ur /home/kjetil/faust2/compiler/generator/llvm/llvm_instructions.hh ./compiler/generator/llvm/llvm_instructions.hh
--- /home/kjetil/faust2/compiler/generator/llvm/llvm_instructions.hh	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/generator/llvm/llvm_instructions.hh	2016-06-07 13:31:46.817116494 +0200
@@ -41,7 +41,7 @@
 #include "exception.hh"
 #include "global.hh"
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/DerivedTypes.h>
     #include <llvm/IR/LLVMContext.h>
     #include <llvm/IR/Module.h>
@@ -51,15 +51,21 @@
     #include <llvm/Module.h>
 #endif
 
+#if defined(LLVM_38)
+    #define GET_ITERATOR(it) &(*it)
+#else
+    #define GET_ITERATOR(it) it
+#endif
+
 #include <llvm/ExecutionEngine/ExecutionEngine.h>
 
-#if defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/ExecutionEngine/MCJIT.h>
 #else
     #include <llvm/ExecutionEngine/JIT.h>
 #endif
 
-#if defined(LLVM_37)
+#if defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/PassManager.h>
 #else
     #include <llvm/PassManager.h>
@@ -71,13 +77,13 @@
 #include <llvm/Support/raw_ostream.h>
 #include <llvm/Support/Host.h>
 
-#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/Verifier.h>
 #else
     #include <llvm/Analysis/Verifier.h>
 #endif
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/IRBuilder.h>
 #elif defined(LLVM_32) 
     #include <llvm/IRBuilder.h>
@@ -86,7 +92,7 @@
     #include <llvm/Support/IRBuilder.h>
 #endif
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
     #include <llvm/IR/DataLayout.h>
 #endif
 
@@ -285,7 +291,7 @@
         VECTOR_OF_TYPES fDSPFields;
         int fDSPFieldsCounter;
         string fPrefix;
-    #if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+    #if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
         DataLayout* fDataLayout;
     #endif
 
@@ -330,7 +336,8 @@
 
             // llvm_free_dsp block
             Function::arg_iterator args = func_llvm_free_dsp->arg_begin();
-            Value* ptr_dsp = args++;
+            Value* ptr_dsp = GET_ITERATOR(args++);
+            
             ptr_dsp->setName("dsp");
 
             BasicBlock* entry_func_llvm_free_dsp = BasicBlock::Create(fModule->getContext(), "entry", func_llvm_free_dsp);
@@ -372,7 +379,7 @@
                     func_allocate->setCallingConv(CallingConv::C);
                     func_allocate->setAlignment(2);
                     Function::arg_iterator llvm_allocate_args_it = func_allocate->arg_begin();
-                    Value* dsp = llvm_allocate_args_it++;
+                    Value* dsp = GET_ITERATOR(llvm_allocate_args_it++);
                     dsp->setName("dsp");
                 } else {
                     func_allocate = fModule->getFunction("allocate" + fPrefix);
@@ -388,7 +395,7 @@
             // llvm_create_dsp block
             BasicBlock* entry_func_llvm_create_dsp = BasicBlock::Create(fModule->getContext(), "entry", func_llvm_create_dsp);
 
-        #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+        #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
             CallInst* call_inst1 = CallInst::Create(func_malloc, genInt64(fModule, fDataLayout->getTypeSizeInBits(dsp_type)), "", entry_func_llvm_create_dsp);
         #else
             // Dynamically computed object size (see http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt)
@@ -547,9 +554,9 @@
 
             // Name arguments
             Function::arg_iterator func_llvm_buildUserInterface_args_it = llvm_buildUserInterface->arg_begin();
-            Value* dsp = func_llvm_buildUserInterface_args_it++;
+            Value* dsp = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
             dsp->setName("dsp");
-            Value* interface1 = func_llvm_buildUserInterface_args_it++;
+            Value* interface1 = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
             interface1->setName("interface");
 
             // Create init block
@@ -576,7 +583,7 @@
             initTypes(module);
         #if defined(LLVM_35) || defined(LLVM_36)
             fDataLayout = new DataLayout(*module->getDataLayout());
-        #elif defined(LLVM_34)  || defined(LLVM_37)
+        #elif defined(LLVM_34)  || defined(LLVM_37) || defined(LLVM_38)
             fDataLayout = new DataLayout(module->getDataLayout());
         #endif
         }
@@ -585,7 +592,7 @@
         {
             // External object not covered by Garbageable, so delete it here
             delete fBuilder;
-        #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+        #if defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
             delete fDataLayout;
         #endif
         }
@@ -622,7 +629,7 @@
                 // Set name for function arguments
                 Function::arg_iterator args = function->arg_begin();
                 for (it = inst->fType->fArgsTypes.begin(); it != inst->fType->fArgsTypes.end(); it++) {
-                    Value* llvm_arg = args++;
+                    Value* llvm_arg = GET_ITERATOR(args++);
                     llvm_arg->setName((*it)->fName);
                 }
             }
@@ -720,7 +727,7 @@
                 func_destroy->setCallingConv(CallingConv::C);
                 func_destroy->setAlignment(2);
                 Function::arg_iterator llvm_destroy_args_it = func_destroy->arg_begin();
-                Value* dsp = llvm_destroy_args_it++;
+                Value* dsp = GET_ITERATOR(llvm_destroy_args_it++);
                 dsp->setName("dsp");
             } else {
                 func_destroy = fModule->getFunction("destroy" + fPrefix);
@@ -735,7 +742,7 @@
 
             // llvm_free_dsp block
             Function::arg_iterator args = func_llvm_free_dsp->arg_begin();
-            Value* ptr_dsp = args++;
+            Value* ptr_dsp = GET_ITERATOR(args++);
             ptr_dsp->setName("dsp");
 
             BasicBlock* entry_func_llvm_free_dsp = BasicBlock::Create(fModule->getContext(), "entry", func_llvm_free_dsp);
@@ -919,7 +926,7 @@
             }
         }
         
-    #if defined(LLVM_37)
+    #if defined(LLVM_37) || defined(LLVM_38)
         GlobalVariable* addStringConstant(string arg, llvm::Type*& type_def)
     #else
         GlobalVariable* addStringConstant(string arg)
@@ -932,7 +939,7 @@
                 GlobalVariable* gvar_array_string0 = new GlobalVariable(*fModule, array_type, true, GlobalValue::InternalLinkage, 0, str);
                 gvar_array_string0->setInitializer(ConstantDataArray::getString(fModule->getContext(), str, true));
                 fGlobalStringTable[str] = gvar_array_string0;
-            #if defined(LLVM_37)
+            #if defined(LLVM_37) || defined(LLVM_38)
                 type_def = array_type;
             #endif
                 return gvar_array_string0;
@@ -962,8 +969,8 @@
         {
             Function* llvm_buildUserInterface = fModule->getFunction("buildUserInterface" + fPrefix);
             Function::arg_iterator func_llvm_buildUserInterface_args_it = llvm_buildUserInterface->arg_begin();
-            Value* dsp = func_llvm_buildUserInterface_args_it++;
-            Value* ui = func_llvm_buildUserInterface_args_it++;
+            Value* dsp = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
+            Value* ui = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
 
             Value* idx[2];
             idx[0] = genInt64(fModule, 0);
@@ -972,7 +979,7 @@
             LoadInst* mth = fBuilder->CreateLoad(mth_ptr);
 
             // Get LLVM constant string
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             llvm::Type* type_def = nullptr;
             GlobalVariable* llvm_key = addStringConstant(inst->fKey, type_def);
             Value* const_string1 = fBuilder->CreateConstGEP2_32(type_def, llvm_key, 0, 0);
@@ -991,7 +998,7 @@
                 zone_ptr = Constant::getNullValue((itfloat() == Typed::kFloat) ? fTypeMap[Typed::kFloat_ptr] : fTypeMap[Typed::kDouble_ptr]);
             } else {
                 int field_index = fDSPFieldsNames[inst->fZone];
-            #if defined(LLVM_37)
+            #if defined(LLVM_37) || defined(LLVM_38)
                 zone_ptr = fBuilder->CreateStructGEP(nullptr, dsp, field_index);
             #else
                 zone_ptr = fBuilder->CreateStructGEP(dsp, field_index);
@@ -1013,11 +1020,11 @@
             Function* llvm_buildUserInterface = fModule->getFunction("buildUserInterface" + fPrefix);
             Function::arg_iterator func_llvm_buildUserInterface_args_it = llvm_buildUserInterface->arg_begin();
             func_llvm_buildUserInterface_args_it++;
-            Value* ui = func_llvm_buildUserInterface_args_it++;
+            Value* ui = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
 
             // Get LLVM constant string
             string name = replaceSpacesWithUnderscore(inst->fName);
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             llvm::Type* type_def = nullptr;
             GlobalVariable* llvm_name = addStringConstant(inst->fName, type_def);
             Value* const_string = fBuilder->CreateConstGEP2_32(type_def, llvm_name, 0, 0);
@@ -1042,7 +1049,7 @@
             idx[1] = mth_index;
             Value* mth_ptr = fBuilder->CreateInBoundsGEP(ui, MAKE_IXD(idx, idx+2));
             LoadInst* mth = fBuilder->CreateLoad(mth_ptr);
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             Value* fun_args[] = { fUIInterface_ptr, const_string };
             CallInst* call_inst = fBuilder->CreateCall(mth, fun_args);
         #else
@@ -1056,7 +1063,7 @@
             Function* llvm_buildUserInterface = fModule->getFunction("buildUserInterface" + fPrefix);
             Function::arg_iterator func_llvm_buildUserInterface_args_it = llvm_buildUserInterface->arg_begin();
             func_llvm_buildUserInterface_args_it++;
-            Value* ui = func_llvm_buildUserInterface_args_it++;
+            Value* ui = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
 
             Value* idx[2];
             idx[0] = genInt64(fModule, 0);
@@ -1072,12 +1079,12 @@
         {
             Function* llvm_buildUserInterface = fModule->getFunction("buildUserInterface" + fPrefix);
             Function::arg_iterator func_llvm_buildUserInterface_args_it = llvm_buildUserInterface->arg_begin();
-            Value* dsp = func_llvm_buildUserInterface_args_it++;
-            Value* ui = func_llvm_buildUserInterface_args_it++;
+            Value* dsp = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
+            Value* ui = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
 
             // Get LLVM constant string
             string name = replaceSpacesWithUnderscore(label);
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             llvm::Type* type_def = nullptr;
             GlobalVariable* llvm_label = addStringConstant(label, type_def);
             Value* const_string = fBuilder->CreateConstGEP2_32(type_def, llvm_label, 0, 0);
@@ -1094,7 +1101,7 @@
 
             // Generates access to zone
             int field_index = fDSPFieldsNames[zone];
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             Value* zone_ptr = fBuilder->CreateStructGEP(nullptr, dsp, field_index);
             Value* fun_args[] = { fUIInterface_ptr, const_string, zone_ptr };
             CallInst* call_inst = fBuilder->CreateCall(mth, fun_args);
@@ -1124,12 +1131,12 @@
         {
             Function* llvm_buildUserInterface = fModule->getFunction("buildUserInterface" + fPrefix);
             Function::arg_iterator func_llvm_buildUserInterface_args_it = llvm_buildUserInterface->arg_begin();
-            Value* dsp = func_llvm_buildUserInterface_args_it++;
-            Value* ui = func_llvm_buildUserInterface_args_it++;
+            Value* dsp = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
+            Value* ui = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
 
             // Get LLVM constant string
             string name = replaceSpacesWithUnderscore(label);
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             llvm::Type* type_def = nullptr;
             GlobalVariable* llvm_label = addStringConstant(label, type_def);
             Value* const_string = fBuilder->CreateConstGEP2_32(type_def, llvm_label, 0, 0);
@@ -1146,7 +1153,7 @@
 
             // Generates access to zone
             int field_index = fDSPFieldsNames[zone];
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             Value* zone_ptr = fBuilder->CreateStructGEP(nullptr, dsp, field_index);
         #else
             Value* zone_ptr = fBuilder->CreateStructGEP(dsp, field_index);
@@ -1186,12 +1193,12 @@
         {
             Function* llvm_buildUserInterface = fModule->getFunction("buildUserInterface" + fPrefix);
             Function::arg_iterator func_llvm_buildUserInterface_args_it = llvm_buildUserInterface->arg_begin();
-            Value* dsp = func_llvm_buildUserInterface_args_it++;
-            Value* ui = func_llvm_buildUserInterface_args_it++;
+            Value* dsp = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
+            Value* ui = GET_ITERATOR(func_llvm_buildUserInterface_args_it++);
 
             // Get LLVM constant string
             string name = replaceSpacesWithUnderscore(label);
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             llvm::Type* type_def = nullptr;
             GlobalVariable* llvm_label = addStringConstant(label, type_def);
             Value* const_string = fBuilder->CreateConstGEP2_32(type_def, llvm_label, 0, 0);
@@ -1208,7 +1215,7 @@
 
             // Generates access to zone
             int field_index = fDSPFieldsNames[zone];
-        #if defined(LLVM_37)
+        #if defined(LLVM_37) || defined(LLVM_38)
             Value* zone_ptr = fBuilder->CreateStructGEP(nullptr, dsp, field_index);
         #else
             Value* zone_ptr = fBuilder->CreateStructGEP(dsp, field_index);
@@ -1262,8 +1269,8 @@
                 // If we have an explicit alloca builder, use it
                 if (fAllocaBuilder->GetInsertBlock()) {
                     // Always at the begining since the block is already branched to next one...
-                    fAllocaBuilder->SetInsertPoint(fAllocaBuilder->GetInsertBlock()->getFirstInsertionPt()); 
-                    fCurValue = fAllocaBuilder->CreateAlloca(convertFIRType(fModule, inst->fType));
+                  fAllocaBuilder->SetInsertPoint(GET_ITERATOR(fAllocaBuilder->GetInsertBlock()->getFirstInsertionPt()));
+                  fCurValue = fAllocaBuilder->CreateAlloca(convertFIRType(fModule, inst->fType));
                 } else {
                     fCurValue = fBuilder->CreateAlloca(convertFIRType(fModule, inst->fType));
                 }
@@ -1355,7 +1362,7 @@
                 function = Function::Create(fun_type, (inst->fType->fAttribute & FunTyped::kLocal) ? GlobalValue::InternalLinkage : GlobalValue::ExternalLinkage, inst->fName, fModule);
                 function->setCallingConv(CallingConv::C);
                 
-            #if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+            #if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
                 // In order for auto-vectorization to correctly work with vectorizable math functions
                 if (find(gMathLibTable.begin(), gMathLibTable.end(), inst->fName) != gMathLibTable.end()) {
                     function->setDoesNotAccessMemory();
@@ -1369,7 +1376,7 @@
                 // Set name for function arguments
                 Function::arg_iterator args = function->arg_begin();
                 for (it = inst->fType->fArgsTypes.begin(); it != inst->fType->fArgsTypes.end(); it++) {
-                    Value* llvm_arg = args++;
+                    Value* llvm_arg = GET_ITERATOR(args++);
                     llvm_arg->setName((*it)->fName);
                 }
 
@@ -1450,7 +1457,7 @@
             // Get the enclosing function
             Function* function = fBuilder->GetInsertBlock()->getParent();
             Function::arg_iterator function_args_it = function->arg_begin();
-            return function_args_it++;
+            return GET_ITERATOR(function_args_it++);
         }
         
         Value* getDSPArg(const string& name)
@@ -1462,7 +1469,7 @@
             Value* arg = NULL;
             bool found = false;
             do {
-                arg = function_args_it++;
+                arg = GET_ITERATOR(function_args_it++);
                 if (arg->getName() == name) {
                     found = true;
                     break;
@@ -1476,7 +1483,7 @@
         {
             if (named_address->fAccess & Address::kStruct) {
                 int field_index = fDSPFieldsNames[named_address->fName];
-            #if defined(LLVM_37)
+            #if defined(LLVM_37) || defined(LLVM_38)
                 return fBuilder->CreateStructGEP(nullptr, getDSP(), field_index);
             #else
                 return fBuilder->CreateStructGEP(getDSP(), field_index);
@@ -1648,7 +1655,7 @@
                 
             if (named_address->fAccess & Address::kStruct) {
                 int field_index = fDSPFieldsNames[named_address->fName];
-            #if defined(LLVM_37)
+            #if defined(LLVM_37) || defined(LLVM_38)
                 Value* store_ptr = fBuilder->CreateStructGEP(nullptr, getDSP(), field_index);
             #else
                 Value* store_ptr = fBuilder->CreateStructGEP(getDSP(), field_index);
@@ -2322,7 +2329,7 @@
                 // Inst result for comparison
                 return generateScalarSelect(opcode, comp_value, genInt32(fModule, 1, size), genInt32(fModule, 0, size), size);
             } else {
-            #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37))
+            #if (defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38))
                 LlvmValue value = fBuilder->CreateBinOp((Instruction::BinaryOps)gBinOpTable[opcode]->fLlvmFloatInst, arg1, arg2);
                 Instruction* inst = cast<Instruction>(value);
                 inst->setMetadata(LLVMContext::MD_fpmath, fBuilder->getDefaultFPMathTag());
diff -ur /home/kjetil/faust2/compiler/Makefile.unix ./compiler/Makefile.unix
--- /home/kjetil/faust2/compiler/Makefile.unix	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/Makefile.unix	2016-06-07 13:35:05.934705869 +0200
@@ -76,39 +76,43 @@
 
 ifeq ($(LLVM_VERSION), 3.1)
     LLVM_VERSION = LLVM_31
-endif
 
-ifeq ($(LLVM_VERSION), 3.2)
+else ifeq ($(LLVM_VERSION), 3.2)
     LLVM_VERSION = LLVM_32
-endif
 
-ifeq ($(LLVM_VERSION), 3.3)
+else ifeq ($(LLVM_VERSION), 3.3)
     LLVM_VERSION = LLVM_33
-endif
 
-ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.4 3.4.1 3.4.2))
+else ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.4 3.4.1 3.4.2))
     LLVM_VERSION = LLVM_34
     CLANGLIBS=$(CLANGLIBSLIST)
-endif
 
-ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.5.0 3.5.1 3.5.2))
+else ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.5.0 3.5.1 3.5.2))
     LLVM_VERSION = LLVM_35
     CLANGLIBS=$(CLANGLIBSLIST)
     CXXFLAGS += -std=gnu++11
-endif
 
-ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.6.0 3.6.1 3.6.2))
+else ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.6.0 3.6.1 3.6.2))
     LLVM_VERSION = LLVM_36
     CLANGLIBS=$(CLANGLIBSLIST)
     CXXFLAGS += -std=gnu++11
-endif
 
-ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.7.0 3.7.1 3.7.2))
+else ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.7.0 3.7.1 3.7.2))
     LLVM_VERSION = LLVM_37
     CLANGLIBS=$(CLANGLIBSLIST)
     CXXFLAGS += -std=gnu++11
+
+else ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.8.0))
+    LLVM_VERSION = LLVM_38
+    CLANGLIBS=$(CLANGLIBSLIST)
+    CXXFLAGS += -std=gnu++11
+
+else
+    $(error "Unknown LLVM version $(LLVM_VERSION)")
+
 endif
 
+
 ifeq ($(system), Darwin)
     #CXXFLAGS += -g
     CXXFLAGS += -O3
diff -ur /home/kjetil/faust2/compiler/signals/binop.cpp ./compiler/signals/binop.cpp
--- /home/kjetil/faust2/compiler/signals/binop.cpp	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/signals/binop.cpp	2016-06-07 13:32:52.584302070 +0200
@@ -32,7 +32,7 @@
 
 #if LLVM_BUILD
 
-#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37)
+#if defined(LLVM_33) || defined(LLVM_34) || defined(LLVM_35) || defined(LLVM_36) || defined(LLVM_37) || defined(LLVM_38)
 #include <llvm/IR/Instructions.h>
 #else
 #include <llvm/Instructions.h>
diff -ur /home/kjetil/faust2/compiler/tlib/compatibility.hh ./compiler/tlib/compatibility.hh
--- /home/kjetil/faust2/compiler/tlib/compatibility.hh	2016-06-06 16:26:32.000000000 +0200
+++ ./compiler/tlib/compatibility.hh	2016-06-07 10:49:45.475711296 +0200
@@ -22,7 +22,7 @@
 #ifndef __COMPATIBILITY__
 #define __COMPATIBILITY__
  
-#define LLVM_BUILD (LLVM_31 || LLVM_32 || LLVM_33 || LLVM_34 || LLVM_35 || LLVM_36 || LLVM_37)
+#define LLVM_BUILD (LLVM_31 || LLVM_32 || LLVM_33 || LLVM_34 || LLVM_35 || LLVM_36 || LLVM_37 || LLVM_38)
 
 unsigned faust_alarm(unsigned seconds);
 
diff -ur /home/kjetil/faust2/examples/Makefile ./examples/Makefile
--- /home/kjetil/faust2/examples/Makefile	2016-06-06 16:26:32.000000000 +0200
+++ ./examples/Makefile	2016-06-07 13:34:24.151952699 +0200
@@ -65,6 +65,12 @@
 CLANGLIBS=$(CLANGLIBSLIST)
 endif
 
+ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.8.0))
+LLVM_VERSION  = LLVM_38
+CLANG = /opt/local/libexec/llvm-3.8/bin/clang++
+CLANGLIBS=$(CLANGLIBSLIST)
+endif
+
 ifeq ($(OSC),1)
  OSCCTRL := -DOSCCTRL -I$(FAUSTINC)/gui/
  QTDEFS  := OSCCTRL
diff -ur /home/kjetil/faust2/examples/Makefile.llvmcompile ./examples/Makefile.llvmcompile
--- /home/kjetil/faust2/examples/Makefile.llvmcompile	2016-06-06 16:26:32.000000000 +0200
+++ ./examples/Makefile.llvmcompile	2016-06-07 13:34:48.173385707 +0200
@@ -42,6 +42,11 @@
 LLVM_PREFIX = /opt/local/libexec/llvm-3.7/bin
 endif
 
+ifeq ($(LLVM_VERSION),$(filter $(LLVM_VERSION), 3.8.0))
+LLVM_VERSION  = LLVM_38
+LLVM_PREFIX = /opt/local/libexec/llvm-3.8/bin
+endif
+
 CLANG = $(LLVM_PREFIX)/clang++
 OPT = $(LLVM_PREFIX)/opt
 LLC = $(LLVM_PREFIX)/llc
