A supersonic cloud-cloud collision produces a shock-compressed layer which leads to formation of high-mass stars via gravitational instability. We carried out a detailed analysis of the layer by using the numerical simulations of magneto-hydrodynamics which deal with colliding molecular flows at a relative velocity of 20 km s$^{-1}$ (Inoue & Fukui 2013). Maximum density in the layer increases from 1000 cm$^{-3}$ to more than $10^{5}$ cm$^{-3}$ within 0.3 Myrs by compression, and the turbulence and the magnetic field in the layer are amplified by a factor of $sim 5$, increasing the mass accretion rate by two orders of magnitude to more than $10^{-4}$ $M_{odot}$ yr$^{-1}$. The layer becomes highly filamentary due to gas flows along the magnetic field lines, and dense cores are formed in the filaments. The massive dense cores have size and mass of 0.03 -- 0.8 pc and 8 -- 50 $M_{odot}$ and they are usually gravitationally unstable. The mass function of the dense cores is significantly top-heavy as compared with the universal IMF, indicating that the cloud-cloud collision triggers preferentially the formation of O and early B stars. We argue that the cloud-cloud collision is a versatile mechanism which creates a variety of stellar clusters from a single O star like RCW120 and M20 to tens of O stars of a super star cluster like RCW38 and a mini-starburst W43. The core mass function predicted by the present model is consistent with the massive dense cores obtained by recent ALMA observations in RCW38 (Torii et al. 2019) and W43 (Motte et al. 2018) considering the increasing evidence for collision-triggered high-mass star formation, we argue that cloud-cloud collision is a major mechanism of high mass star formation.