summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-14 18:57:46 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-14 18:57:46 +0000
commite711f7052e47be6daee85137e23b6c28857b9f05 (patch)
treeb87ddb4465918a765f6d440488f99bc811178494 /clang/lib/Analysis
parent978f08d9b4852579b91a9bce765da4427f8aeedf (diff)
downloadbcm5719-llvm-e711f7052e47be6daee85137e23b6c28857b9f05.tar.gz
bcm5719-llvm-e711f7052e47be6daee85137e23b6c28857b9f05.zip
Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the appropriate "format" attribute to NSLog, NSLogv, asprintf, and vasprintf, and to translate builtin attributes (from Builtins.def) into actual attributes on the function declaration. Use the "printf" format attribute on function declarations to determine whether we should do format string checking, rather than looking at an ad hoc list of builtins and "known" function names. Be a bit more careful about when we consider a function a "builtin" in C++. llvm-svn: 64561
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index a48b18c9c6d..1a7f35960ce 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -1263,7 +1263,8 @@ void GRExprEngine::VisitCallRec(CallExpr* CE, NodeTy* Pred,
if (isa<loc::FuncVal>(L)) {
- if (unsigned id = cast<loc::FuncVal>(L).getDecl()->getBuiltinID())
+ if (unsigned id
+ = cast<loc::FuncVal>(L).getDecl()->getBuiltinID(getContext()))
switch (id) {
case Builtin::BI__builtin_expect: {
// For __builtin_expect, just return the value of the subexpression.
OpenPOWER on IntegriCloud