private void deleteEmptyCategoryPaths(CategoryPath cp) {
		DataTypeManager dtm = prog.getGhidraProgram().getDataTypeManager();
		while (!CategoryPath.ROOT.equals(cp)) {
			Category cat = dtm.getCategory(cp);
			Category parentCat = dtm.getCategory(cp.getParent());
			if (cat == null || parentCat == null) {
				break;
			}

			if (cat.getDataTypes().length != 0 || cat.getCategories().length != 0) {
				break;
			}

			if (!parentCat.removeEmptyCategory(cat.getName(), monitor)) {
				Msg.error(this, "Failed to delete empty category " + cp);
				break;
			}
			cp = parentCat.getCategoryPath();
		}
	}
Moves previously imported DataTypes from the /DWARF/_UNCATEGORIZED_ folder into
folder /DWARF/source_code_filename.ext/...
<p>
When moving / renaming DataTypes, you only need to worry about named DataTypes.
Pointers and Arrays, which can only exist by referring to a named DataType, get
moved / renamed automagically by the DataTypeManager.
<p>
After moving each DataType, if the folder is empty, remove the folder.

@throws CancelledException
Ghidra/Features/Base/src/main/java/ghidra/app/util/bin/format/dwarf/DWARFImporter.java