private void removeUnnecessaryPadding(Composite packedComposite) {
		if (!packedComposite.isPackingEnabled()) {
			throw new IllegalArgumentException("composite must have packing enabled");
		}
		if (!(packedComposite instanceof Structure struct)) {
			return;
		}
		int preferredLength = packedComposite.getLength();
		DataTypeComponent[] definedComponents = struct.getDefinedComponents();
		int lastIndex = definedComponents.length - 1;
		for (int i = 0; i < definedComponents.length; i++) {
			DataTypeComponent dtc = definedComponents[i];
			if (!isPaddingComponent(dtc, true)) {
				continue; // leave bitfield padding intact
			}
			int nextComponentOffset = -1;
			if (i < lastIndex) {
				nextComponentOffset = definedComponents[i + 1].getOffset();
			}
			int ordinal = dtc.getOrdinal();

			// experiment with padding removal and restore if removal impacts structure
			struct.delete(ordinal);

			if (struct.getLength() != preferredLength || (nextComponentOffset > 0 &&
				nextComponentOffset != definedComponents[i + 1].getOffset())) {
				// restore padding component
				struct.insert(ordinal, dtc.getDataType(), -1, PADDING_COMPONENT_NAME, null);
			}
		}
	}
Computes and sets the alignment of the composite.  Will not set an alignment if the
calculation does not make sense
@param composite the composite to affect
Ghidra/Features/PDB/src/main/java/ghidra/app/util/bin/format/pdb/DefaultCompositeMember.java