clang API Documentation

Classes | Public Member Functions
clang::LayoutOverrideSource Class Reference

An external AST source that overrides the layout of a specified set of record types. More...

#include <LayoutOverrideSource.h>

Inheritance diagram for clang::LayoutOverrideSource:
Inheritance graph
[legend]
Collaboration diagram for clang::LayoutOverrideSource:
Collaboration graph
[legend]

List of all members.

Classes

struct  Layout
 The layout of a given record.

Public Member Functions

 LayoutOverrideSource (StringRef Filename)
 Create a new AST source that overrides the layout of some set of record types.
bool layoutRecordType (const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, llvm::DenseMap< const FieldDecl *, uint64_t > &FieldOffsets, llvm::DenseMap< const CXXRecordDecl *, CharUnits > &BaseOffsets, llvm::DenseMap< const CXXRecordDecl *, CharUnits > &VirtualBaseOffsets) override
 If this particular record type has an overridden layout, return that layout.
void dump ()
 Dump the overridden layouts.

Detailed Description

An external AST source that overrides the layout of a specified set of record types.

This class is used only for testing the ability of external AST sources to override the layout of record types. Its input is the output format of the command-line argument -fdump-record-layouts.

Definition at line 25 of file LayoutOverrideSource.h.


Constructor & Destructor Documentation

LayoutOverrideSource::LayoutOverrideSource ( StringRef  Filename) [explicit]

Create a new AST source that overrides the layout of some set of record types.

The file is the result of passing -fdump-record-layouts to a file.

Definition at line 30 of file LayoutOverrideSource.cpp.

References Input, clang::isDigit(), clang::isWhitespace(), Line, and parseName().


Member Function Documentation

Dump the overridden layouts.

Definition at line 191 of file LayoutOverrideSource.cpp.

bool LayoutOverrideSource::layoutRecordType ( const RecordDecl Record,
uint64_t &  Size,
uint64_t &  Alignment,
llvm::DenseMap< const FieldDecl *, uint64_t > &  FieldOffsets,
llvm::DenseMap< const CXXRecordDecl *, CharUnits > &  BaseOffsets,
llvm::DenseMap< const CXXRecordDecl *, CharUnits > &  VirtualBaseOffsets 
) [override, virtual]

If this particular record type has an overridden layout, return that layout.

Reimplemented from clang::ExternalASTSource.

Definition at line 156 of file LayoutOverrideSource.cpp.

References clang::NamedDecl::getIdentifier(), and clang::NamedDecl::getName().


The documentation for this class was generated from the following files: