In this paper, we study the three-dimensional (3D) simultaneous localization and mapping (SLAM) problem in complex outdoor and indoor environments based only on millimeter-wave (mmWave) wireless communication signals. Firstly, we propose a deep-learning based mapping (DLM) algorithm that can leverage the reflections point on the first-order none line-of-sight (NLOS) communications links (CLs) to build the 3D point cloud map of the environment. Specifically, we design a classification neural network to identify the first-order NLOS CL and theoretically calculate the geometric coordinates of the reflection points on it. Secondly, we take the advantage of both the inertial measurement unit and the beam-squint assisted localization method to realize real-time and precise localizations. Then, combining the DLM and the adopted localization algorithm, we develop the communication-based SLAM (C-SLAM) framework that can carry out SLAM without any prior knowledge of the environment. Moreover, extensive simulations of both complex outdoor and indoor environments validate the effectiveness of our approach.