clang: lib/AST/DeclGroup.cpp Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9

10

11

12

15#include

16#include

17

18using namespace clang;

19

21 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

28DeclGroup::DeclGroup(unsigned numdecls, Decl** decls) : NumDecls(numdecls) {

29 assert(numdecls > 0);

30 assert(decls);

31 std::uninitialized_copy(decls, decls + numdecls,

32 getTrailingObjects<Decl *>());

33}

Defines the clang::ASTContext interface.

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)

Decl - This represents one declaration (or definition), e.g.

The JSON file list parser is used to communicate input to InstallAPI.