summaryrefslogtreecommitdiffstats
path: root/clang/AST/Decl.cpp
diff options
context:
space:
mode:
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