OSDN Git Service

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)
commit753bd2a772884fced63111b5d41c02c2d5f6ff7e
tree97731a60f61b0b998e34267b31f1f834ee462f48
parent7bfedca6fc415b0e5edea211f299142b03de1e97
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299699 91177308-0d34-0410-b5e6-96231b3b80d8
22 files changed:
include/llvm/IR/Module.h
lib/CodeGen/CountingFunctionInserter.cpp
lib/CodeGen/IntrinsicLowering.cpp
lib/CodeGen/MachineOutliner.cpp
lib/CodeGen/SafeStack.cpp
lib/CodeGen/SjLjEHPrepare.cpp
lib/CodeGen/StackProtector.cpp
lib/CodeGen/TargetLoweringBase.cpp
lib/IR/Instructions.cpp
lib/IR/Module.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Transforms/IPO/CrossDSOCFI.cpp
lib/Transforms/IPO/WholeProgramDevirt.cpp
lib/Transforms/Instrumentation/AddressSanitizer.cpp
lib/Transforms/Instrumentation/EfficiencySanitizer.cpp
lib/Transforms/Instrumentation/MemorySanitizer.cpp
lib/Transforms/Instrumentation/SanitizerCoverage.cpp
lib/Transforms/Instrumentation/ThreadSanitizer.cpp
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
lib/Transforms/Utils/BuildLibCalls.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
tools/lli/lli.cpp