diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-08-22 04:22:50 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-08-22 04:22:50 +0000 |
commit | 118da50a2aa6eb6464cf39e81b165f171fa13802 (patch) | |
tree | e026825ecfc6005576d14deaa7ab699af82a4dce /clang/lib/AST/MangleNumberingContext.cpp | |
parent | 05a09c67da39911785aba17cb24db99801eccc5a (diff) | |
download | bcm5719-llvm-118da50a2aa6eb6464cf39e81b165f171fa13802.tar.gz bcm5719-llvm-118da50a2aa6eb6464cf39e81b165f171fa13802.zip |
MS ABI: Don't use the Itanium scheme for numbering lambdas
The Itanium ABI will give out the same mangling number for two different
lambdas if their call operators have different types. The MS ABI cannot
do the same because it does not mangle the return type into it's
lambdas.
This fixes PR20719.
llvm-svn: 216259
Diffstat (limited to 'clang/lib/AST/MangleNumberingContext.cpp')
-rw-r--r-- | clang/lib/AST/MangleNumberingContext.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/clang/lib/AST/MangleNumberingContext.cpp b/clang/lib/AST/MangleNumberingContext.cpp deleted file mode 100644 index 5f40f0347d0..00000000000 --- a/clang/lib/AST/MangleNumberingContext.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//===--- MangleNumberingContext.cpp - Context for mangling numbers --------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the LambdaMangleContext class, which keeps track of -// the Itanium C++ ABI mangling numbers for lambda expressions. -// -//===----------------------------------------------------------------------===// - -#include "clang/AST/MangleNumberingContext.h" -#include "clang/AST/ASTContext.h" -#include "clang/AST/DeclCXX.h" - -using namespace clang; - -unsigned -MangleNumberingContext::getManglingNumber(const CXXMethodDecl *CallOperator) { - const FunctionProtoType *Proto - = CallOperator->getType()->getAs<FunctionProtoType>(); - ASTContext &Context = CallOperator->getASTContext(); - - QualType Key = Context.getFunctionType(Context.VoidTy, Proto->getParamTypes(), - FunctionProtoType::ExtProtoInfo()); - Key = Context.getCanonicalType(Key); - return ++ManglingNumbers[Key->castAs<FunctionProtoType>()]; -} - -unsigned -MangleNumberingContext::getManglingNumber(const BlockDecl *BD) { - // FIXME: Compute a BlockPointerType? Not obvious how. - const Type *Ty = nullptr; - return ++ManglingNumbers[Ty]; -} - -unsigned -MangleNumberingContext::getStaticLocalNumber(const VarDecl *VD) { - // FIXME: Compute a BlockPointerType? Not obvious how. - const Type *Ty = nullptr; - return ++ManglingNumbers[Ty]; -} |