summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index abde26ae533..040c5467ac5 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -3114,31 +3114,15 @@ void Sema::AddKnownFunctionAttributes(FunctionDecl *FD) {
} else
return;
- unsigned KnownID;
- for (KnownID = 0; KnownID != id_num_known_functions; ++KnownID)
- if (KnownFunctionIDs[KnownID] == Name)
- break;
-
- switch (KnownID) {
- case id_NSLog:
- case id_NSLogv:
+ if (Name->isStr("NSLog") || Name->isStr("NSLogv")) {
if (const FormatAttr *Format = FD->getAttr<FormatAttr>()) {
// FIXME: We known better than our headers.
const_cast<FormatAttr *>(Format)->setType("printf");
} else
FD->addAttr(::new (Context) FormatAttr("printf", 1, 2));
- break;
-
- case id_asprintf:
- case id_vasprintf:
+ } else if (Name->isStr("asprintf") || Name->isStr("vasprintf")) {
if (!FD->getAttr<FormatAttr>())
FD->addAttr(::new (Context) FormatAttr("printf", 2, 3));
- break;
-
- default:
- // Unknown function or known function without any attributes to
- // add. Do nothing.
- break;
}
}
OpenPOWER on IntegriCloud