@Override
	public void encode(Encoder encoder) throws IOException {
		encoder.openElement(ELEM_COMPILER_SPEC);
		encodeProperties(encoder);
		dataOrganization.encode(encoder);
		ContextSetting.encodeContextData(encoder, ctxsetting);
		if (aggressiveTrim) {
			encoder.openElement(ELEM_AGGRESSIVETRIM);
			encoder.writeBool(ATTRIB_SIGNEXT, aggressiveTrim);
			encoder.closeElement(ELEM_AGGRESSIVETRIM);
		}
		if (stackPointer != null) {
			encoder.openElement(ELEM_STACKPOINTER);
			encoder.writeString(ATTRIB_REGISTER, stackPointer.getName());
			encoder.writeSpace(ATTRIB_SPACE, stackBaseSpace);
			if (reverseJustifyStack) {
				encoder.writeBool(ATTRIB_REVERSEJUSTIFY, reverseJustifyStack);
			}
			if (!stackGrowsNegative) {
				encoder.writeString(ATTRIB_GROWTH, "positive");
			}
			encoder.closeElement(ELEM_STACKPOINTER);
		}
		encodeSpaceBases(encoder);
		encodeMemoryTags(encoder, ELEM_GLOBAL, globalSet);
		encodeReturnAddress(encoder);			// Must come before PrototypeModels
		pcodeInject.encodeCompilerSpec(encoder);
		if (defaultModel != null) {
			encoder.openElement(ELEM_DEFAULT_PROTO);
			defaultModel.encode(encoder, pcodeInject);
			encoder.closeElement(ELEM_DEFAULT_PROTO);
		}
		for (PrototypeModel model : allmodels) {
			if (model == defaultModel) {
				continue;		// Already emitted
			}
			model.encode(encoder, pcodeInject);
		}
		if (evalCurrentModel != null && evalCurrentModel != defaultModel) {
			encoder.openElement(ELEM_EVAL_CURRENT_PROTOTYPE);
			encoder.writeString(ATTRIB_NAME, evalCurrentModel.name);
			encoder.closeElement(ELEM_EVAL_CURRENT_PROTOTYPE);
		}
		if (evalCalledModel != null && evalCalledModel != defaultModel) {
			encoder.openElement(ELEM_EVAL_CALLED_PROTOTYPE);
			encoder.writeString(ATTRIB_NAME, evalCalledModel.name);
			encoder.closeElement(ELEM_EVAL_CALLED_PROTOTYPE);
		}
		encodePreferSplit(encoder);
		encodeMemoryTags(encoder, ELEM_NOHIGHPTR, noHighPtr);
		encodeMemoryTags(encoder, ELEM_READONLY, readOnlySet);
		if (funcPtrAlign != 0) {
			encoder.openElement(ELEM_FUNCPTR);
			encoder.writeSignedInteger(ATTRIB_ALIGN, funcPtrAlign);
			encoder.closeElement(ELEM_FUNCPTR);
		}
		encodeDeadCodeDelay(encoder);
		encodeInferPtrBounds(encoder);
		encoder.closeElement(ELEM_COMPILER_SPEC);
	}
Establish cross referencing to prototype models.
All xrefs are regenerated from a single complete list of PrototypeModels.
If there are PrototypeModels with duplicate names, return an example name.
Return null otherwise
The modelList must provide a model with name matching defaultName or
an exception is thrown.  (In theory the schema guarantees this model always exists)

@param modelList is the complete list of models
@param defaultName is the name to use for the default model
@param evalCurrent is the name to use for evaluating the current function (or null)
@param evalCalled is the name to use for evaluating called functions (or null)
@return a PrototypeModel name that was duplicated or null
@throws XmlParseException if there is no model matching defaultName
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/BasicCompilerSpec.java