Merge pull request #828 from ncos/ispc_build_fails

Add support for LLVM 3.6 build
This commit is contained in:
Dmitry Babokin
2014-07-30 16:56:02 +04:00
16 changed files with 73 additions and 49 deletions

View File

@@ -113,7 +113,9 @@ ifeq ($(LLVM_VERSION),LLVM_3_4)
ISPC_LIBS += -lcurses
endif
ifeq ($(LLVM_VERSION),LLVM_3_5)
# There is no logical OR in GNU make.
# This 'ifneq' acts like if($(LLVM_VERSION) == LLVM_3_5 || $(LLVM_VERSION) == LLVM_3_6)
ifneq (,$(filter $(LLVM_VERSION), LLVM_3_5 LLVM_3_6))
ISPC_LIBS += -lcurses -lz
endif
@@ -150,7 +152,9 @@ CXXFLAGS=$(OPT) $(LLVM_CXXFLAGS) -I. -Iobjs/ -I$(CLANG_INCLUDE) \
-Wall \
-DBUILD_DATE="\"$(BUILD_DATE)\"" -DBUILD_VERSION="\"$(BUILD_VERSION)\"" \
-Wno-sign-compare -Wno-unused-function -Werror
ifeq ($(LLVM_VERSION),LLVM_3_5)
# if($(LLVM_VERSION) == LLVM_3_5 || $(LLVM_VERSION) == LLVM_3_6)
ifneq (,$(filter $(LLVM_VERSION), LLVM_3_5 LLVM_3_6))
CXXFLAGS+=-std=c++11 -Wno-c99-extensions -Wno-deprecated-register
endif
ifneq ($(ARM_ENABLED), 0)

View File

@@ -111,6 +111,9 @@ def build_LLVM(version_LLVM, revision, folder, tarball, debug, selfbuild, extra,
FOLDER_NAME=version_LLVM
if version_LLVM == "trunk":
SVN_PATH="trunk"
if version_LLVM == "3.5":
SVN_PATH="tags/RELEASE_35/rc1"
version_LLVM = "3_5"
if version_LLVM == "3.4":
SVN_PATH="tags/RELEASE_34/dot2-final"
version_LLVM = "3_4"
@@ -351,8 +354,10 @@ def build_ispc(version_LLVM, make):
temp = "3_3"
if version_LLVM == "3.4":
temp = "3_4"
if version_LLVM == "trunk":
if version_LLVM == "3.5":
temp = "3_5"
if version_LLVM == "trunk":
temp = "3_6"
os.environ["LLVM_VERSION"] = "LLVM_" + temp
try_do_LLVM("clean ISPC for building", "msbuild ispc.vcxproj /t:clean", True)
try_do_LLVM("build ISPC with LLVM version " + version_LLVM + " ", "msbuild ispc.vcxproj /V:m /p:Platform=Win32 /p:Configuration=Release /t:rebuild", True)
@@ -454,7 +459,7 @@ def validation_run(only, only_targets, reference_branch, number, notify, update,
archs.append("x86-64")
if "native" in only:
sde_targets_t = []
for i in ["3.1", "3.2", "3.3", "3.4", "trunk"]:
for i in ["3.1", "3.2", "3.3", "3.4", "3.5", "trunk"]:
if i in only:
LLVM.append(i)
if "current" in only:
@@ -707,7 +712,7 @@ def Main():
if os.environ.get("SMTP_ISPC") == None:
error("you have no SMTP_ISPC in your environment for option notify", 1)
if options.only != "":
test_only_r = " 3.1 3.2 3.3 3.4 trunk current build stability performance x86 x86-64 -O0 -O2 native "
test_only_r = " 3.1 3.2 3.3 3.4 3.5 trunk current build stability performance x86 x86-64 -O0 -O2 native "
test_only = options.only.split(" ")
for iterator in test_only:
if not (" " + iterator + " " in test_only_r):
@@ -816,7 +821,7 @@ if __name__ == '__main__':
llvm_group = OptionGroup(parser, "Options for building LLVM",
"These options must be used with -b option.")
llvm_group.add_option('--version', dest='version',
help='version of llvm to build: 3.1 3.2 3.3 3.4 trunk. Default: trunk', default="trunk")
help='version of llvm to build: 3.1 3.2 3.3 3.4 3.5 trunk. Default: trunk', default="trunk")
llvm_group.add_option('--revision', dest='revision',
help='revision of llvm to build in format r172870', default="")
llvm_group.add_option('--debug', dest='debug',
@@ -851,7 +856,7 @@ if __name__ == '__main__':
run_group.add_option('--only', dest='only',
help='set types of tests. Possible values:\n' +
'-O0, -O2, x86, x86-64, stability (test only stability), performance (test only performance)\n' +
'build (only build with different LLVM), 3.1, 3.2, 3.3, 3.4, trunk, native (do not use SDE), current (do not rebuild ISPC).',
'build (only build with different LLVM), 3.1, 3.2, 3.3, 3.4 3.5, trunk, native (do not use SDE), current (do not rebuild ISPC).',
default="")
run_group.add_option('--perf_LLVM', dest='perf_llvm',
help='compare LLVM 3.3 with "--compare-with", default trunk', default=False, action='store_true')

View File

@@ -66,7 +66,7 @@
#include <llvm/IR/Intrinsics.h>
#include <llvm/IR/DerivedTypes.h>
#endif
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/Linker/Linker.h>
#else
#include <llvm/Linker.h>
@@ -705,7 +705,7 @@ AddBitcodeToModule(const unsigned char *bitcode, int length,
llvm::Module *module, SymbolTable *symbolTable) {
llvm::StringRef sb = llvm::StringRef((char *)bitcode, length);
llvm::MemoryBuffer *bcBuf = llvm::MemoryBuffer::getMemBuffer(sb);
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
llvm::ErrorOr<llvm::Module *> ModuleOrErr = llvm::parseBitcodeFile(bcBuf, *g->ctx);
if (std::error_code EC = ModuleOrErr.getError())
Error(SourcePos(), "Error parsing stdlib bitcode: %s", EC.message().c_str());
@@ -762,7 +762,7 @@ AddBitcodeToModule(const unsigned char *bitcode, int length,
// architecture and investigate what happened.
// Generally we allow library DataLayout to be subset of module
// DataLayout or library DataLayout to be empty.
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
if (!VerifyDataLayoutCompatibility(module->getDataLayoutStr(),
bcModule->getDataLayoutStr())) {
Warning(SourcePos(), "Module DataLayout is incompatible with "

View File

@@ -1497,13 +1497,17 @@ define <$1 x $2> @__atomic_compare_exchange_$3_global($2* %ptr, <$1 x $2> %cmp,
per_lane($1, <$1 x MASK> %mask, `
%cmp_LANE_ID = extractelement <$1 x $2> %cmp, i32 LANE
%val_LANE_ID = extractelement <$1 x $2> %val, i32 LANE
;; 3.5 and 3.6 code is the same since m4 has no OR and AND operators
ifelse(LLVM_VERSION,LLVM_3_5,`
%r_LANE_ID_t = cmpxchg $2 * %ptr, $2 %cmp_LANE_ID, $2 %val_LANE_ID seq_cst seq_cst
%r_LANE_ID = extractvalue { $2, i1 } %r_LANE_ID_t, 0
',LLVM_VERSION,LLVM_3_6,`
%r_LANE_ID_t = cmpxchg $2 * %ptr, $2 %cmp_LANE_ID, $2 %val_LANE_ID seq_cst seq_cst
%r_LANE_ID = extractvalue { $2, i1 } %r_LANE_ID_t, 0
',`
%r_LANE_ID = cmpxchg $2 * %ptr, $2 %cmp_LANE_ID, $2 %val_LANE_ID seq_cst
')
%rp_LANE_ID = getelementptr $2 * %rptr32, i32 LANE
store $2 %r_LANE_ID, $2 * %rp_LANE_ID')
@@ -1512,10 +1516,14 @@ define <$1 x $2> @__atomic_compare_exchange_$3_global($2* %ptr, <$1 x $2> %cmp,
}
define $2 @__atomic_compare_exchange_uniform_$3_global($2* %ptr, $2 %cmp,
$2 %val) nounwind alwaysinline {
$2 %val) nounwind alwaysinline {
;; 3.5 and 3.6 code is the same since m4 has no OR and AND operators
ifelse(LLVM_VERSION,LLVM_3_5,`
%r_t = cmpxchg $2 * %ptr, $2 %cmp, $2 %val seq_cst seq_cst
%r = extractvalue { $2, i1 } %r_t, 0
',LLVM_VERSION,LLVM_3_6,`
%r_t = cmpxchg $2 * %ptr, $2 %cmp, $2 %val seq_cst seq_cst
%r = extractvalue { $2, i1 } %r_t, 0
',`
%r = cmpxchg $2 * %ptr, $2 %cmp, $2 %val seq_cst
')

View File

@@ -63,7 +63,7 @@
#include "llvm/Analysis/ConstantsScanner.h"
#include "llvm/Analysis/FindUsedTypes.h"
#include "llvm/Analysis/LoopInfo.h"
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include "llvm/IR/Verifier.h"
#include <llvm/IR/IRPrintingPasses.h>
#include "llvm/IR/CallSite.h"
@@ -250,7 +250,7 @@ namespace {
class CBEMCAsmInfo : public llvm::MCAsmInfo {
public:
CBEMCAsmInfo() {
#if !defined(LLVM_3_5)
#if !defined(LLVM_3_5) && !defined(LLVM_3_6)
GlobalPrefix = "";
#endif
PrivateGlobalPrefix = "";
@@ -465,7 +465,7 @@ namespace {
// Must not be used in inline asm, extractelement, or shufflevector.
if (I.hasOneUse()) {
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
const llvm::Instruction &User = llvm::cast<llvm::Instruction>(*I.user_back());
#else
const llvm::Instruction &User = llvm::cast<llvm::Instruction>(*I.use_back());
@@ -477,7 +477,7 @@ namespace {
}
// Only inline instruction it if it's use is in the same BB as the inst.
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
return I.getParent() == llvm::cast<llvm::Instruction>(I.user_back())->getParent();
#else
return I.getParent() == llvm::cast<llvm::Instruction>(I.use_back())->getParent();
@@ -1770,7 +1770,7 @@ std::string CWriter::GetValueName(const llvm::Value *Operand) {
// Resolve potential alias.
if (const llvm::GlobalAlias *GA = llvm::dyn_cast<llvm::GlobalAlias>(Operand)) {
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
if (const llvm::Value *V = GA->getAliasee())
#else
if (const llvm::Value *V = GA->resolveAliasedGlobal(false))
@@ -2163,7 +2163,7 @@ static SpecialGlobalClass getGlobalVariableClass(const llvm::GlobalVariable *GV)
// Otherwise, if it is other metadata, don't print it. This catches things
// like debug information.
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
// Here we compare char *
if (!strcmp(GV->getSection(), "llvm.metadata"))
#else
@@ -2225,7 +2225,7 @@ bool CWriter::doInitialization(llvm::Module &M) {
#endif
TAsm = new CBEMCAsmInfo();
MRI = new llvm::MCRegisterInfo();
#if defined(LLVM_3_4) || defined(LLVM_3_5)
#if defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
TCtx = new llvm::MCContext(TAsm, MRI, NULL);
#else
TCtx = new llvm::MCContext(*TAsm, *MRI, NULL);
@@ -2349,7 +2349,7 @@ bool CWriter::doInitialization(llvm::Module &M) {
if (I->hasExternalLinkage() || I->hasExternalWeakLinkage() ||
I->hasCommonLinkage())
Out << "extern ";
#if defined (LLVM_3_5)
#if defined (LLVM_3_5) || defined(LLVM_3_6)
else if (I->hasDLLImportStorageClass())
#else
else if (I->hasDLLImportLinkage())
@@ -2525,7 +2525,7 @@ bool CWriter::doInitialization(llvm::Module &M) {
if (I->hasLocalLinkage())
Out << "static ";
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
else if (I->hasDLLImportStorageClass()) Out << "__declspec(dllimport) ";
else if (I->hasDLLExportStorageClass()) Out << "__declspec(dllexport) ";
#else
@@ -2810,7 +2810,7 @@ void CWriter::printFunctionSignature(const llvm::Function *F, bool Prototype) {
bool isStructReturn = F->hasStructRetAttr();
if (F->hasLocalLinkage()) Out << "static ";
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
if (F->hasDLLImportStorageClass()) Out << "__declspec(dllimport) ";
if (F->hasDLLExportStorageClass()) Out << "__declspec(dllexport) ";
#else
@@ -3145,7 +3145,7 @@ void CWriter::visitSwitchInst(llvm::SwitchInst &SI) {
Out << ":\n";
printPHICopiesForSuccessor (SI.getParent(), Succ, 2);
printBranchToBlock(SI.getParent(), Succ, 2);
#if defined (LLVM_3_5)
#if defined (LLVM_3_5) || defined(LLVM_3_6)
if (llvm::Function::iterator(Succ) == std::next(llvm::Function::iterator(SI.getParent())))
#else
if (llvm::Function::iterator(Succ) == llvm::next(llvm::Function::iterator(SI.getParent())))
@@ -3170,7 +3170,7 @@ bool CWriter::isGotoCodeNecessary(llvm::BasicBlock *From, llvm::BasicBlock *To)
/// FIXME: This should be reenabled, but loop reordering safe!!
return true;
#if defined (LLVM_3_5)
#if defined (LLVM_3_5) || defined(LLVM_3_6)
if (std::next(llvm::Function::iterator(From)) != llvm::Function::iterator(To))
#else
if (llvm::next(llvm::Function::iterator(From)) != llvm::Function::iterator(To))
@@ -3788,7 +3788,7 @@ void CWriter::lowerIntrinsics(llvm::Function &F) {
// All other intrinsic calls we must lower.
llvm::Instruction *Before = 0;
if (CI != &BB->front())
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
Before = std::prev(llvm::BasicBlock::iterator(CI));
#else
Before = prior(llvm::BasicBlock::iterator(CI));

View File

@@ -352,7 +352,7 @@ FunctionEmitContext::FunctionEmitContext(Function *func, Symbol *funSym,
AssertPos(currentPos, diSubprogramType.Verify());
}
#if defined(LLVM_3_4) || defined(LLVM_3_5)
#if defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
Assert(diSubprogramType.isCompositeType());
llvm::DICompositeType diSubprogramType_n =
static_cast<llvm::DICompositeType>(diSubprogramType);
@@ -1546,7 +1546,7 @@ FunctionEmitContext::StartScope() {
llvm::DILexicalBlock lexicalBlock =
m->diBuilder->createLexicalBlock(parentScope, diFile,
currentPos.first_line,
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
// Revision 202736 in LLVM adds support of DWARF discriminator
// to the last argument and revision 202737 in clang adds 0
// for the last argument by default.

2
ctx.h
View File

@@ -47,7 +47,7 @@
#include <llvm/IR/InstrTypes.h>
#include <llvm/IR/Instructions.h>
#endif
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/DebugInfo.h>
#include <llvm/IR/DIBuilder.h>
#else

View File

@@ -74,7 +74,7 @@
#include <llvm/IR/CallingConv.h>
#endif
#include <llvm/ExecutionEngine/GenericValue.h>
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/InstIterator.h>
#else
#include <llvm/Support/InstIterator.h>

View File

@@ -69,7 +69,7 @@
#include <llvm/Target/TargetMachine.h>
#include <llvm/Target/TargetOptions.h>
#include <llvm/PassManager.h>
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/Verifier.h>
#include <llvm/IR/IRPrintingPasses.h>
#include <llvm/IR/CFG.h>
@@ -478,7 +478,7 @@ Function::GenerateIR() {
}
if (m->errorCount == 0) {
#if defined (LLVM_3_5)
#if defined (LLVM_3_5) || defined(LLVM_3_6)
if (llvm::verifyFunction(*function) == true) {
#else
if (llvm::verifyFunction(*function, llvm::ReturnStatusAction) == true) {
@@ -528,7 +528,7 @@ Function::GenerateIR() {
emitCode(&ec, appFunction, firstStmtPos);
if (m->errorCount == 0) {
sym->exportedFunction = appFunction;
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
if (llvm::verifyFunction(*appFunction) == true) {
#else
if (llvm::verifyFunction(*appFunction,

View File

@@ -57,7 +57,7 @@
#include <llvm/IR/Module.h>
#include <llvm/IR/Instructions.h>
#endif
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/DebugInfo.h>
#include <llvm/IR/DIBuilder.h>
#else

4
ispc.h
View File

@@ -40,8 +40,8 @@
#define ISPC_VERSION "1.7.1dev"
#if !defined(LLVM_3_1) && !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5)
#error "Only LLVM 3.1, 3.2, 3.3, 3.4 and the 3.5 development branch are supported"
#if !defined(LLVM_3_1) && !defined(LLVM_3_2) && !defined(LLVM_3_3) && !defined(LLVM_3_4) && !defined(LLVM_3_5) && !defined(LLVM_3_6)
#error "Only LLVM 3.1, 3.2, 3.3, 3.4, 3.5 and the 3.6 development branch are supported"
#endif
#if defined(_WIN32) || defined(_WIN64)

View File

@@ -72,6 +72,8 @@ lPrintVersion() {
"3.4"
#elif defined(LLVM_3_5)
"3.5"
#elif defined(LLVM_3_6)
"3.6"
#else
#error "Unhandled LLVM version"
#endif
@@ -166,7 +168,7 @@ devUsage(int ret) {
printf(" disable-uniform-memory-optimizations\tDisable uniform-based coherent memory access\n");
printf(" [--yydebug]\t\t\t\tPrint debugging information during parsing\n");
printf(" [--debug-phase=<value>]\t\tSet optimization phases to dump. --debug-phase=first,210:220,300,305,310:last\n");
#if defined(LLVM_3_4) || defined(LLVM_3_5)
#if defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
printf(" [--debug-ir=<value>]\t\tSet optimization phase to generate debugIR after it\n");
#endif
printf(" [--off-phase=<value>]\t\tSwitch off optimization phases. --off-phase=first,210:220,300,305,310:last\n");
@@ -549,7 +551,7 @@ int main(int Argc, char *Argv[]) {
"away or introduce the new ones.\n");
g->debug_stages = ParsingPhases(argv[i] + strlen("--debug-phase="));
}
#if defined(LLVM_3_4) || defined(LLVM_3_5)
#if defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
else if (strncmp(argv[i], "--debug-ir=", 11) == 0) {
g->debugIR = ParsingPhaseName(argv[i] + strlen("--debug-ir="));
}

View File

@@ -93,7 +93,7 @@
#include <llvm/IR/DataLayout.h>
#include <llvm/Analysis/TargetTransformInfo.h>
#endif
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/Verifier.h>
#include <llvm/IR/IRPrintingPasses.h>
#include <llvm/IR/CFG.h>
@@ -948,7 +948,7 @@ Module::writeOutput(OutputType outputType, const char *outFileName,
lStripUnusedDebugInfo(module);
}
#if defined (LLVM_3_4) || defined (LLVM_3_5)
#if defined (LLVM_3_4) || defined (LLVM_3_5) || defined(LLVM_3_6)
// In LLVM_3_4 after r195494 and r195504 revisions we should pass
// "Debug Info Version" constant to the module. LLVM will ignore
// our Debug Info metadata without it.
@@ -1105,7 +1105,7 @@ Module::writeObjectFileOrAssembly(llvm::TargetMachine *targetMachine,
}
llvm::PassManager pm;
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
pm.add(new llvm::DataLayoutPass(*g->target->getDataLayout()));
#else
pm.add(new llvm::DataLayout(*g->target->getDataLayout()));
@@ -2114,7 +2114,7 @@ Module::execPreprocessor(const char *infilename, llvm::raw_string_ostream *ostre
}
inst.getLangOpts().LineComment = 1;
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
inst.createPreprocessor(clang::TU_Complete);
#else
inst.createPreprocessor();

View File

@@ -44,7 +44,7 @@
#if defined(LLVM_3_4)
#include <llvm/DebugInfo.h>
#endif
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/DebugInfo.h>
#endif

View File

@@ -63,12 +63,12 @@
#include <llvm/IR/BasicBlock.h>
#include <llvm/IR/Constants.h>
#endif
#if defined (LLVM_3_4) || defined(LLVM_3_5)
#if defined (LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/Transforms/Instrumentation.h>
#endif
#include <llvm/PassManager.h>
#include <llvm/PassRegistry.h>
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/Verifier.h>
#include <llvm/IR/IRPrintingPasses.h>
#include <llvm/IR/PatternMatch.h>
@@ -444,7 +444,7 @@ DebugPassManager::add(llvm::Pass * P, int stage = -1) {
number, P->getPassName());
PM.add(CreateDebugPass(buf));
}
#if defined(LLVM_3_4) || defined(LLVM_3_5)
#if defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
if (g->debugIR == number) {
// adding generating of LLVM IR debug after optimization
char buf[100];
@@ -469,7 +469,7 @@ Optimize(llvm::Module *module, int optLevel) {
new llvm::TargetLibraryInfo(llvm::Triple(module->getTargetTriple()));
optPM.add(targetLibraryInfo);
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
optPM.add(new llvm::DataLayoutPass(*g->target->getDataLayout()));
#else
optPM.add(new llvm::DataLayout(*g->target->getDataLayout()));

View File

@@ -50,7 +50,7 @@
#include <llvm/IR/Value.h>
#include <llvm/IR/Module.h>
#endif
#if defined(LLVM_3_5)
#if defined(LLVM_3_5) || defined(LLVM_3_6)
#include <llvm/IR/DebugInfo.h>
#include <llvm/IR/DIBuilder.h>
#else
@@ -2987,16 +2987,21 @@ FunctionType::GetDIType(llvm::DIDescriptor scope) const {
for (int i = 0; i < GetNumParameters(); ++i) {
const Type *t = GetParameterType(i);
if (t == NULL)
#if defined(LLVM_3_4) || defined(LLVM_3_5)
#if defined(LLVM_3_4) || defined(LLVM_3_5) || defined(LLVM_3_6)
return llvm::DICompositeType();
#else
return llvm::DIType();
#endif
retArgTypes.push_back(t->GetDIType(scope));
}
#if defined(LLVM_3_6)
llvm::DITypeArray retArgTypesArray =
m->diBuilder->getOrCreateTypeArray(llvm::ArrayRef<llvm::Value *>(retArgTypes));
#else
llvm::DIArray retArgTypesArray =
m->diBuilder->getOrCreateArray(llvm::ArrayRef<llvm::Value *>(retArgTypes));
#endif
llvm::DIType diType =
// FIXME: DIFile
m->diBuilder->createSubroutineType(llvm::DIFile(), retArgTypesArray);