summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-10-06 05:00:56 +0000
committerTed Kremenek <kremenek@apple.com>2011-10-06 05:00:56 +0000
commit540017e54e55afbbbd711341c786833c38b299b6 (patch)
tree59439b6db0ab4c57df825c92a19d791c144d6107 /clang/lib/AST/ASTContext.cpp
parent9504ae937049b69a4986270080244b5c7f085081 (diff)
downloadbcm5719-llvm-540017e54e55afbbbd711341c786833c38b299b6.tar.gz
bcm5719-llvm-540017e54e55afbbbd711341c786833c38b299b6.zip
Use a sidetable in ASTContext for ParmVarDecls whose index exceeds the 8 bits reserved for that value in VarDecl. Fixes PR 10538.
llvm-svn: 141273
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 6f68c2dc2f4..055ed7c08c6 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -6516,3 +6516,14 @@ size_t ASTContext::getSideTableAllocatedMemory() const {
+ llvm::capacity_in_bytes(VariableArrayTypes)
+ llvm::capacity_in_bytes(ClassScopeSpecializationPattern);
}
+
+void ASTContext::setParameterIndex(const ParmVarDecl *D, unsigned int index) {
+ ParamIndices[D] = index;
+}
+
+unsigned ASTContext::getParameterIndex(const ParmVarDecl *D) const {
+ ParameterIndexTable::const_iterator I = ParamIndices.find(D);
+ assert(I != ParamIndices.end() &&
+ "ParmIndices lacks entry set by ParmVarDecl");
+ return I->second;
+}
OpenPOWER on IntegriCloud