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.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/AST/Decl.cpp b/clang/AST/Decl.cpp
index 11d92055c11..7e8cea9ae07 100644
--- a/clang/AST/Decl.cpp
+++ b/clang/AST/Decl.cpp
@@ -47,6 +47,21 @@ void FunctionDecl::setParams(VarDecl **NewParamInfo, unsigned NumParams) {
}
+/// defineElements - When created, EnumDecl correspond to a forward declared
+/// enum. This method is used to mark the decl as being defined, with the
+/// specified contents.
+void EnumDecl::defineElements(EnumConstantDecl **Elts, unsigned NumElts) {
+ assert(!isDefinition() && "Cannot redefine enums!");
+ setDefinition(true);
+ NumElements = NumElts;
+ if (NumElts) {
+ Elements = new EnumConstantDecl*[NumElts];
+ memcpy(Elements, Elts, NumElts*sizeof(Decl*));
+ }
+}
+
+
+
/// 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.
OpenPOWER on IntegriCloud