Cleanup swift_library after Bazel release

* Remove obsolete code paths and format the file to keep 2 lines between top-level methods.

--
MOS_MIGRATED_REVID=136842040
diff --git a/tools/build_defs/apple/swift.bzl b/tools/build_defs/apple/swift.bzl
index deb8027..74bd498 100644
--- a/tools/build_defs/apple/swift.bzl
+++ b/tools/build_defs/apple/swift.bzl
@@ -24,6 +24,7 @@
   """Returns a set of parent directories for each directory in dirs."""
   return set([f.rpartition("/")[0] for f in dirs])
 
+
 def _intersperse(separator, iterable):
   """Inserts separator before each item in iterable."""
   result = []
@@ -33,6 +34,7 @@
 
   return result
 
+
 def _swift_target(cpu, platform, sdk_version):
   """Returns a target triplet for Swift compiler."""
   platform_string = str(platform.platform_type)
@@ -41,6 +43,7 @@
 
   return "%s-apple-%s%s" % (cpu, platform_string, sdk_version)
 
+
 def _swift_compilation_mode_flags(ctx):
   """Returns additional swiftc flags for the current compilation mode."""
   mode = ctx.var["COMPILATION_MODE"]
@@ -51,6 +54,7 @@
   elif mode == "opt":
     return ["-O", "-DNDEBUG"]
 
+
 def _clang_compilation_mode_flags(ctx):
   """Returns additional clang flags for the current compilation mode."""
 
@@ -62,22 +66,23 @@
 
   return [x for x in native_clang_flags if x != "-g"]
 
+
 def _swift_bitcode_flags(ctx):
   """Returns bitcode flags based on selected mode."""
-  # TODO(dmishe): Remove this when bitcode_mode is available by default.
-  if hasattr(ctx.fragments.apple, "bitcode_mode"):
-    mode = str(ctx.fragments.apple.bitcode_mode)
-    if mode == "embedded":
-      return ["-embed-bitcode"]
-    elif mode == "embedded_markers":
-      return ["-embed-bitcode-marker"]
+  mode = str(ctx.fragments.apple.bitcode_mode)
+  if mode == "embedded":
+    return ["-embed-bitcode"]
+  elif mode == "embedded_markers":
+    return ["-embed-bitcode-marker"]
 
   return []
 
+
 def _module_name(ctx):
   """Returns a module name for the given rule context."""
   return ctx.label.package.lstrip("//").replace("/", "_") + "_" + ctx.label.name
 
+
 def _swift_lib_dir(ctx):
   """Returns the location of swift runtime directory to link against."""
   # TODO(dmishe): Expose this template from native code.
@@ -97,19 +102,18 @@
   return "{0}/Toolchains/{1}.xctoolchain/usr/lib/swift/{2}".format(
       developer_dir, toolchain_name, platform_str)
 
+
 def _swift_linkopts(ctx):
   """Returns additional linker arguments for the given rule context."""
   return set(["-L" + _swift_lib_dir(ctx)])
 
+
 def _swift_xcrun_args(ctx):
   """Returns additional arguments that should be passed to xcrun."""
-  # TODO(dmishe): Remove this check when xcode_toolchain is available by default
-  args = []
-  if hasattr(ctx.fragments.apple, "xcode_toolchain"):
-    if ctx.fragments.apple.xcode_toolchain:
-      args += ["--toolchain", ctx.fragments.apple.xcode_toolchain]
+  if ctx.fragments.apple.xcode_toolchain:
+    return ["--toolchain", ctx.fragments.apple.xcode_toolchain]
 
-  return args
+  return []
 
 
 def _is_valid_swift_module_name(string):