[dfsan] New calling convention for custom functions with variadic arguments.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 30 Oct 2014 13:22:57 +0000 (13:22 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 30 Oct 2014 13:22:57 +0000 (13:22 +0000)
commit015aedb1b586fe3bcedf97e6837da88f76249e69
tree81f160c07d577f9bdd3f96eea17f655423544097
parentb0d3f649713d82e5bdef034b481ceac0762a4a34
[dfsan] New calling convention for custom functions with variadic arguments.

Summary:
The previous calling convention prevented custom functions from being able
to access argument labels unless it knew how many variadic arguments there
were, and of which type. This restriction made it impossible to correctly
model functions in the printf family, as it is legal to pass more arguments
than required to those functions. We now pass arguments in the following order:

non-vararg arguments
labels for non-vararg arguments
[if vararg function, pointer to array of labels for vararg arguments]
[if non-void function, pointer to label for return value]
vararg arguments

Differential Revision: http://reviews.llvm.org/D6028

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220906 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
test/Instrumentation/DataFlowSanitizer/abilist.ll