summaryrefslogtreecommitdiffstats
path: root/clang/AST/Decl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-25 04:52:46 +0000
committerChris Lattner <sabre@nondot.org>2007-01-25 04:52:46 +0000
commit4194315681f1f0b04f7c097634aad047f78bd43a (patch)
tree60ea16246f85dd21d173bb9d6b23fb117976300a /clang/AST/Decl.cpp
parent720a054994599d85efb526f2da2267065760d267 (diff)
downloadbcm5719-llvm-4194315681f1f0b04f7c097634aad047f78bd43a.tar.gz
bcm5719-llvm-4194315681f1f0b04f7c097634aad047f78bd43a.zip
Save the member list of a struct/union in the RecordDecl for the struct.
llvm-svn: 39297
Diffstat (limited to 'clang/AST/Decl.cpp')
-rw-r--r--clang/AST/Decl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/AST/Decl.cpp b/clang/AST/Decl.cpp
index 7bad5a1102b..7a88fcbec03 100644
--- a/clang/AST/Decl.cpp
+++ b/clang/AST/Decl.cpp
@@ -45,3 +45,17 @@ void FunctionDecl::setParams(VarDecl **NewParamInfo, unsigned NumParams) {
memcpy(ParamInfo, NewParamInfo, sizeof(VarDecl*)*NumParams);
}
}
+
+
+/// defineBody - When created, RecordDecl's correspond to a forward declared
+/// record. This method is used to mark the decl as being defined, with the
+/// specified contents.
+void RecordDecl::defineBody(Decl **fields, unsigned numFields) {
+ assert(!isDefinition() && "Cannot redefine record!");
+ setDefinition(true);
+ NumFields = numFields;
+ if (numFields) {
+ Fields = new Decl*[numFields];
+ memcpy(Fields, fields, numFields*sizeof(Decl*));
+ }
+}
OpenPOWER on IntegriCloud