]> granicus.if.org Git - clang/commit
Add hook to add attributes to function declarations that we know
authorDouglas Gregor <dgregor@apple.com>
Sat, 14 Feb 2009 18:57:46 +0000 (18:57 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 14 Feb 2009 18:57:46 +0000 (18:57 +0000)
commit3c385e5f8d9008fff18597ca302be19fa86e51f6
tree8daddebd1007dcd0f23f8a442032c584da996663
parentff975cfab9ada27df86038286d1678084aeb3428
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++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/AST/Attr.h
include/clang/AST/Decl.h
include/clang/AST/Expr.h
lib/AST/Decl.cpp
lib/AST/Expr.cpp
lib/AST/ExprConstant.cpp
lib/Analysis/GRExprEngine.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprConstant.cpp
lib/Sema/Sema.cpp
lib/Sema/Sema.h
lib/Sema/SemaChecking.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaUtil.h [deleted file]
test/Sema/format-strings.c