1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | #include "clang/AST/DeclGroup.h" |
14 | #include "clang/AST/ASTContext.h" |
15 | #include <cassert> |
16 | #include <memory> |
17 | |
18 | using namespace clang; |
19 | |
20 | DeclGroup* DeclGroup::Create(ASTContext &C, Decl **Decls, unsigned NumDecls) { |
21 | (0) . __assert_fail ("NumDecls > 1 && \"Invalid DeclGroup\"", "/home/seafit/code_projects/clang_source/clang/lib/AST/DeclGroup.cpp", 21, __PRETTY_FUNCTION__))" file_link="../../../include/assert.h.html#88" macro="true">assert(NumDecls > 1 && "Invalid DeclGroup"); |
22 | unsigned Size = totalSizeToAlloc<Decl *>(NumDecls); |
23 | void *Mem = C.Allocate(Size, alignof(DeclGroup)); |
24 | new (Mem) DeclGroup(NumDecls, Decls); |
25 | return static_cast<DeclGroup*>(Mem); |
26 | } |
27 | |
28 | DeclGroup::DeclGroup(unsigned numdecls, Decl** decls) : NumDecls(numdecls) { |
29 | 0", "/home/seafit/code_projects/clang_source/clang/lib/AST/DeclGroup.cpp", 29, __PRETTY_FUNCTION__))" file_link="../../../include/assert.h.html#88" macro="true">assert(numdecls > 0); |
30 | assert(decls); |
31 | std::uninitialized_copy(decls, decls + numdecls, |
32 | getTrailingObjects<Decl *>()); |
33 | } |
34 | |