[llvm] Fix a few problems with longs on 32 bit platforms. Fixes #18925.