summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2013-07-01 20:22:57 +0000
committerEli Friedman <eli.friedman@gmail.com>2013-07-01 20:22:57 +0000
commit7e346a81272224048620c7a8b06f9cdb69ae5f7d (patch)
tree6e6d70e66675c926ba24924e68587098068221d7 /clang/lib/AST/ASTContext.cpp
parent8b5b1e072fbeb27447ef0e286f729469dd2bd5e0 (diff)
downloadbcm5719-llvm-7e346a81272224048620c7a8b06f9cdb69ae5f7d.tar.gz
bcm5719-llvm-7e346a81272224048620c7a8b06f9cdb69ae5f7d.zip
Fix mangling for block literals.
Blocks, like lambdas, can be written in contexts which are required to be treated as the same under ODR. Unlike lambdas, it isn't possible to actually take the address of a block, so the mangling of the block itself doesn't matter. However, objects like static variables inside a block do need to be mangled in a consistent way. There are basically three components here. One, block literals need a consistent numbering. Two, objects/types inside a block literal need to be mangled using it. Three, objects/types inside a block literal need to have their linkage computed correctly. llvm-svn: 185372
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 8374316ac64..7f02f59c683 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -8007,13 +8007,10 @@ int ASTContext::getUnnamedTagManglingNumber(const TagDecl *Tag) const {
return I != UnnamedMangleNumbers.end() ? I->second : -1;
}
-unsigned ASTContext::getLambdaManglingNumber(CXXMethodDecl *CallOperator) {
- CXXRecordDecl *Lambda = CallOperator->getParent();
- return LambdaMangleContexts[Lambda->getDeclContext()]
- .getManglingNumber(CallOperator);
+MangleNumberingContext &ASTContext::getManglingNumberContext(DeclContext *DC) {
+ return MangleNumberingContexts[DC];
}
-
void ASTContext::setParameterIndex(const ParmVarDecl *D, unsigned int index) {
ParamIndices[D] = index;
}
OpenPOWER on IntegriCloud