private void setOpVertexAttributes(AttributedVertex vertex, PcodeOpAST op) {

		vertex.setAttribute(CODE_ATTRIBUTE, formatOpMnemonic(op));

		String vertexType = BODY;
		switch (op.getOpcode()) {
			case PcodeOp.BRANCH:
			case PcodeOp.BRANCHIND:
			case PcodeOp.CBRANCH:
			case PcodeOp.CALL:
			case PcodeOp.CALLIND:
				vertexType = SWITCH;
				break;
			case PcodeOp.RETURN:
				vertexType = EXIT;
				break;
		}
		vertex.setVertexType(vertexType);
	}
Task to create a PCode control flow graph based on decompiler output
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/PCodeCfgGraphTask.java