diff options
author | dim <dim@FreeBSD.org> | 2014-05-26 20:45:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-05-26 20:45:44 +0000 |
commit | a3e27ae6a965c81405d106372cb1f9d3a6da6626 (patch) | |
tree | a889320dbbd323fb029d54cc5ef8a03ca448a203 /contrib/llvm/tools/clang/lib/Analysis | |
parent | 0c09b104cdf0b55f5402b37cb18a67d0480c6a5f (diff) | |
download | FreeBSD-src-a3e27ae6a965c81405d106372cb1f9d3a6da6626.zip FreeBSD-src-a3e27ae6a965c81405d106372cb1f9d3a6da6626.tar.gz |
MFC r265925:
Upgrade our copy of llvm/clang to 3.4.1 release. This release contains
mostly fixes, for the following upstream bugs:
http://llvm.org/PR16365 http://llvm.org/PR17473 http://llvm.org/PR18000
http://llvm.org/PR18068 http://llvm.org/PR18102 http://llvm.org/PR18165
http://llvm.org/PR18260 http://llvm.org/PR18290 http://llvm.org/PR18316
http://llvm.org/PR18460 http://llvm.org/PR18473 http://llvm.org/PR18515
http://llvm.org/PR18526 http://llvm.org/PR18600 http://llvm.org/PR18762
http://llvm.org/PR18773 http://llvm.org/PR18860 http://llvm.org/PR18994
http://llvm.org/PR19007 http://llvm.org/PR19010 http://llvm.org/PR19033
http://llvm.org/PR19059 http://llvm.org/PR19144 http://llvm.org/PR19326
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Analysis')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp b/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp index b33c8d8..e5ec3e6 100644 --- a/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp +++ b/contrib/llvm/tools/clang/lib/Analysis/Consumed.cpp @@ -605,13 +605,25 @@ void ConsumedStmtVisitor::VisitBinaryOperator(const BinaryOperator *BinOp) { } } +static bool isStdNamespace(const DeclContext *DC) { + if (!DC->isNamespace()) return false; + while (DC->getParent()->isNamespace()) + DC = DC->getParent(); + const NamespaceDecl *ND = dyn_cast<NamespaceDecl>(DC); + + return ND && ND->getName() == "std" && + ND->getDeclContext()->isTranslationUnit(); +} + void ConsumedStmtVisitor::VisitCallExpr(const CallExpr *Call) { if (const FunctionDecl *FunDecl = dyn_cast_or_null<FunctionDecl>(Call->getDirectCallee())) { // Special case for the std::move function. // TODO: Make this more specific. (Deferred) - if (FunDecl->getNameAsString() == "move") { + if (Call->getNumArgs() == 1 && + FunDecl->getNameAsString() == "move" && + isStdNamespace(FunDecl->getDeclContext())) { forwardInfo(Call->getArg(0), Call); return; } |