An optical microwave waveform generator using a polarization modulator (PolM) in a Sagnac loop is proposed and experimentally demonstrated. Microwave waveforms including a triangular waveform, a sawtooth waveform, and a square waveform, can be generated using a sinusoidal signal to modulate a light wave at a PolM in a Sagnac loop. In the proposed microwave waveform generator, a sinusoidal microwave signal is applied to the PolM in the Sagnac loop. Due to the velocity mismatch, only the clockwise light wave in the Sagnac loop is effectively modulated by the sinusoidal microwave signal at the PolM, and the counter-clockwise light wave is not modulated. Along the clockwise direction, the powers of the odd- and even-order sidebands can be controlled separately by tuning a polarization controller after the PolM. In addition, the output power of the optical carrier can be independently controlled by combining the counter-clockwise and clockwise optical carriers at the output of a polarization beam splitter. As a result, a modulated signal with controllable odd- and even-order sidebands is generated. By applying the modulated signal to a photodetector, a microwave signal with fully controllable odd- and even-order harmonics is generated, which corresponds to a desired microwave waveform. A theoretical analysis is developed, which is validated by an experiment. A triangular, sawtooth, and square waveform with a repetition rate tunable from 2 to 4 GHz is experimentally generated.