Simplify some va_start checking logic
authorReid Kleckner <rnk@google.com>
Tue, 2 May 2017 20:10:03 +0000 (20:10 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 2 May 2017 20:10:03 +0000 (20:10 +0000)
commit2b0fa129d65e802ffeba35fce1ad041de25bedb2
tree475705c850538a0aa09b8f0afc02db13e1950aee
parent24d754271568914a9216a2eaf29b94c948e86b72
Simplify some va_start checking logic

Combine the logic doing the ms_abi/sysv_abi checks into one function so
that each check and its logical opposite are near each other. Now we
don't need two Sema entry points for MS va_start and regular va_start.

Refactor the code that checks if the va_start caller is a function,
block, or obj-c method. We do this in three places, and they are all
buggy for variadic lambdas (PR32737). After this change, I have one
place to apply the functional fix.

NFC

llvm-svn: 301968
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaChecking.cpp
clang/test/Sema/varargs.c