private DWARFDataType makeDataTypeForEnum(DIEAggregate diea) {

		DWARFName dni = prog.getName(diea);
		int enumSize = (int) diea.getUnsignedLong(DW_AT_byte_size, -1);
		// in addition to byte_size, enums can have encoding (signed/unsigned) and a basetype, which
		// itself might have a signed/unsigned encoding.
		// Which attributes are present varies wildly between versions and vendors, so seems 
		// best to just rely on the bare minimum.

		if (enumSize == 0) {
			Msg.warn(this, "Enum " + dni.getNamespacePath() + "[DWARF DIE " + diea.getHexOffset() +
				"] has a size of 0, forcing to 1");
			enumSize = 1;
		}
		if (enumSize == -1) {
			Msg.warn(this, "Enum " + dni.getNamespacePath() + "[DWARF DIE " + diea.getHexOffset() +
				"] does not have a size specified, forcing to 1");
			enumSize = 1;
		}

		Enum enumDT = new EnumDataType(dni.getParentCP(), dni.getName(), enumSize, dataTypeManager);
		populateStubEnum(enumDT, diea, false);

		// Merge enums with the same name / category path if possible
		for (DataType prevDT : dwarfDTM.forAllConflicts(dni.asDataTypePath())) {
			if (prevDT instanceof Enum prevEnum && prevEnum.getLength() == enumDT.getLength()) {
				if (isCompatEnumValues(enumDT, prevEnum)) {
					mergeEnumValues(prevEnum, enumDT);
					return new DWARFDataType(prevEnum, dni, diea.getOffset());
				}
			}
		}

		DataType result =
			dataTypeManager.addDataType(enumDT, DWARFDataTypeConflictHandler.INSTANCE);

		return new DWARFDataType(result, dni, diea.getOffset());
	}
Creates a Ghidra {@link Enum} datatype.
<p>
If an existing Enum with the same name is found in the DTM, and it doesn't have
any conflicting enum values, merge this enum into the existing enum.
<p>
This method takes liberties with the normal{@literal DWARF->Ghidra Impl DataType->Ghidra DB DataType}
workflow to be able to merge values into previous db enum datatypes.

@param diea
@return
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DWARFDataTypeImporter.java