def _swift_bitcode_flags(apple_fragment):
  """Returns bitcode flags based on selected mode."""
  mode = str(apple_fragment.bitcode_mode)
  if mode == "embedded":
    return ["-embed-bitcode"]
  elif mode == "embedded_markers":
    return ["-embed-bitcode-marker"]

  return []