factor out duplicated code into ir_get_constructor_op, and fix switch case warnings
fix more warnings
mac: enable more warnings in xcode project