Module Padding

Import path

semmle.code.cpp.padding.Padding

Imports

cpp

Provides classes and predicates for working with C/C++/ObjC/ObjC++ code.

Classes

Architecture

A string that represents an architecture. An “architecture” defines the sizes of variable-sized types and the properties of alignment for fields of various types. Two are provided out-of-the-box: ILP32 and LP64, corresponding to gcc’s behavior on x86 and amd64.

ILP32

The ILP32 architecture has ints, longs and pointers of 32 bits.

ILP32_MS

The ILP32_MS architecture is essentially the same as the ILP32 architecture, except that long doubles are 64 bits.

LLP64_MS

The LLP64_MS architecture has pointers of 64 bits, but both long and int are still 32 bits.

LP64

The LP64 architecture has longs and pointers of 64 bits.

PaddedType

A class that is subject to padding by the compiler, and hence can introduce waste. Does not include types with virtual member functions, virtual base classes, or multiple base classes. These are excluded due to the complexity of the implementation.

UnixArchitecture

Base class for architectures that follow the Itanium ABI. This includes pretty much everything except Windows, so we’ll refer to this as “UnixArchitecture” to avoid any confusion due to the use of the name “Itanium”.

WindowsArchitecture

Base class for Windows architectures.