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 (llvm::StringRef Filename)
 Create a new AST source that overrides the layout of some set of record types.
virtual 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)
 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 24 of file LayoutOverrideSource.h.


Constructor & Destructor Documentation

LayoutOverrideSource::LayoutOverrideSource ( llvm::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 28 of file LayoutOverrideSource.cpp.

References Input, and parseName().


Member Function Documentation

void LayoutOverrideSource::dump ( )

Dump the overridden layouts.

Definition at line 189 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 
) [virtual]

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

Reimplemented from clang::ExternalASTSource.

Definition at line 154 of file LayoutOverrideSource.cpp.

References clang::RecordDecl::field_begin(), clang::RecordDecl::field_end(), clang::NamedDecl::getIdentifier(), and clang::NamedDecl::getName().


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