diff options
| author | Chris Lattner <sabre@nondot.org> | 2007-01-25 04:52:46 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2007-01-25 04:52:46 +0000 |
| commit | 4194315681f1f0b04f7c097634aad047f78bd43a (patch) | |
| tree | 60ea16246f85dd21d173bb9d6b23fb117976300a /clang/AST/Decl.cpp | |
| parent | 720a054994599d85efb526f2da2267065760d267 (diff) | |
| download | bcm5719-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.cpp | 14 |
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*)); + } +} |

