OS X kernel is Darwin, a BSD based kernel, and the source is open. Apple developed Darwin from NeXTSTEP (OpenStep), Mach, BSD. Xcode's compiler is GCC, which Apple & Google both contributed the clang front end, which is also open. The back end debugger is gdb. The main components of Xcode are open source code. The proprietary part is the Interface. iOS is derived from Darwin. Many OSX technologies are with significant open source components.
If you don't know, don't bullshit.