Turn some C-style vararg into variadic templates
authorMehdi Amini <mehdi.amini@apple.com>
Thu, 6 Apr 2017 20:09:31 +0000 (20:09 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Thu, 6 Apr 2017 20:09:31 +0000 (20:09 +0000)
commit579540a8f7967fdbc8b0bf7cd214a6b12a98a362
tree09f39a11e4a7fde5de6cb576bd373684b4870ad7
parent0680968ff3e4971a870932ef0c9ff6f793bdb289
Turn some C-style vararg into variadic templates

Module::getOrInsertFunction is using C-style vararg instead of
variadic templates.

From a user prospective, it forces the use of an annoying nullptr
to mark the end of the vararg, and there's not type checking on the
arguments. The variadic template is an obvious solution to both
issues.

Patch by: Serge Guelton <serge.guelton@telecom-bretagne.eu>

Differential Revision: https://reviews.llvm.org/D31070

llvm-svn: 299699
22 files changed:
llvm/include/llvm/IR/Module.h
llvm/lib/CodeGen/CountingFunctionInserter.cpp
llvm/lib/CodeGen/IntrinsicLowering.cpp
llvm/lib/CodeGen/MachineOutliner.cpp
llvm/lib/CodeGen/SafeStack.cpp
llvm/lib/CodeGen/SjLjEHPrepare.cpp
llvm/lib/CodeGen/StackProtector.cpp
llvm/lib/CodeGen/TargetLoweringBase.cpp
llvm/lib/IR/Instructions.cpp
llvm/lib/IR/Module.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/lib/Transforms/IPO/CrossDSOCFI.cpp
llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
llvm/lib/Transforms/Instrumentation/EfficiencySanitizer.cpp
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp
llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
llvm/lib/Transforms/Utils/BuildLibCalls.cpp
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/tools/lli/lli.cpp