[BuildPlan] Moved -Xcxx flags to the end of the chain of arguments (#1380)

* [BuildPlan] In reference to SR-6164, moved -Xcxx flags to the end of the chain of arguments.

    - https://bugs.swift.org/browse/SR-6164

* Commented the constraints for argument ordering to allow user overrides
of -Xswiftc, -Xlinker, -Xcc and -Xcxx.

- https://bugs.swift.org/browse/SR-6164
diff --git a/Sources/Build/BuildPlan.swift b/Sources/Build/BuildPlan.swift
index c41246d..292a179 100644
--- a/Sources/Build/BuildPlan.swift
+++ b/Sources/Build/BuildPlan.swift
@@ -179,11 +179,6 @@
         args += buildParameters.toolchain.extraCCFlags
         args += optimizationArguments
 
-        // Add extra C++ flags if this target contains C++ files.
-        if clangTarget.isCXX {
-            args += self.buildParameters.flags.cxxCompilerFlags
-        }
-
         // Only enable ARC on macOS.
       #if os(macOS)
         args += ["-fobjc-arc"]
@@ -196,7 +191,14 @@
         args += ["-I", clangTarget.includeDir.asString]
         args += additionalFlags
         args += moduleCacheArgs
+
+        // User arguments (from -Xcc and -Xcxx below) should follow generated arguments to allow user overrides
         args += buildParameters.flags.cCompilerFlags
+
+        // Add extra C++ flags if this target contains C++ files.
+        if clangTarget.isCXX {
+            args += self.buildParameters.flags.cxxCompilerFlags
+        }
         return args
     }
 
@@ -286,6 +288,8 @@
         args += ["-j\(SwiftCompilerTool.numThreads)", "-DSWIFT_PACKAGE"]
         args += additionalFlags
         args += moduleCacheArgs
+
+        // User arguments (from -Xswiftc) should follow generated arguments to allow user overrides
         args += buildParameters.swiftCompilerFlags
         return args
     }
@@ -417,6 +421,8 @@
         args += ["-Xlinker", "-rpath=$ORIGIN"]
       #endif
         args += objects.map({ $0.asString })
+
+        // User arguments (from -Xlinker and -Xswiftc) should follow generated arguments to allow user overrides
         args += buildParameters.linkerFlags
         args += stripInvalidArguments(buildParameters.swiftCompilerFlags)
         return args