From 3176e97f130184ece0e1a21352c8124cc83ff24a Mon Sep 17 00:00:00 2001 From: dim Date: Wed, 30 Dec 2015 11:49:41 +0000 Subject: Vendor import of clang trunk r256633: https://llvm.org/svn/llvm-project/cfe/trunk@256633 --- lib/StaticAnalyzer/Core/CheckerContext.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/StaticAnalyzer/Core/CheckerContext.cpp') diff --git a/lib/StaticAnalyzer/Core/CheckerContext.cpp b/lib/StaticAnalyzer/Core/CheckerContext.cpp index 6b22bf4..5ec8bfa 100644 --- a/lib/StaticAnalyzer/Core/CheckerContext.cpp +++ b/lib/StaticAnalyzer/Core/CheckerContext.cpp @@ -45,7 +45,7 @@ bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD, if (BId != 0) { if (Name.empty()) return true; - StringRef BName = FD->getASTContext().BuiltinInfo.GetName(BId); + StringRef BName = FD->getASTContext().BuiltinInfo.getName(BId); if (BName.find(Name) != StringRef::npos) return true; } @@ -57,12 +57,8 @@ bool CheckerContext::isCLibraryFunction(const FunctionDecl *FD, return false; // Look through 'extern "C"' and anything similar invented in the future. - const DeclContext *DC = FD->getDeclContext(); - while (DC->isTransparentContext()) - DC = DC->getParent(); - - // If this function is in a namespace, it is not a C library function. - if (!DC->isTranslationUnit()) + // If this function is not in TU directly, it is not a C library function. + if (!FD->getDeclContext()->getRedeclContext()->isTranslationUnit()) return false; // If this function is not externally visible, it is not a C library function. -- cgit v1.1