diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-02-14 18:57:46 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-02-14 18:57:46 +0000 |
| commit | 3c385e5f8d9008fff18597ca302be19fa86e51f6 (patch) | |
| tree | 8daddebd1007dcd0f23f8a442032c584da996663 /lib/CodeGen/CGExpr.cpp | |
| parent | ff975cfab9ada27df86038286d1678084aeb3428 (diff) | |
| download | clang-3c385e5f8d9008fff18597ca302be19fa86e51f6.tar.gz clang-3c385e5f8d9008fff18597ca302be19fa86e51f6.tar.bz2 clang-3c385e5f8d9008fff18597ca302be19fa86e51f6.tar.xz | |
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
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index ddecbebded..3e44c0079b 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -964,7 +964,7 @@ RValue CodeGenFunction::EmitCallExpr(const CallExpr *E) { dyn_cast<const DeclRefExpr>(IcExpr->getSubExpr())) if (const FunctionDecl *FDecl = dyn_cast<const FunctionDecl>(DRExpr->getDecl())) - if (unsigned builtinID = FDecl->getBuiltinID()) + if (unsigned builtinID = FDecl->getBuiltinID(getContext())) return EmitBuiltinExpr(builtinID, E); if (E->getCallee()->getType()->isBlockPointerType()) |
