This patch adds support for generating calls through the procedure linkage table where required for a given ExternalSymbol or GlobalAddress callee.
Do we want to be parsing the @plt for things other than call/tail? PseudoLLA also takes a bare_symbol but @plt isn't valid. Currently we parse bar@plt as a valid bare symbol; however, GNU as will reject it with illegal operands (as I understand it, this is because it doesn't treat @ as part of a valid identifier).
This can be inlined in LowerCall, especially once the fno-plt stuff is gone, as it's the only user.
This seems to be X86-specific in LLVM; do we really need this in RISC-V? Clang's test/CodeGen/noplt.c gives a normal call foo@plt when compiled with riscv64-linux-gnu-gcc -fpic -fno-plt, so I would remove this and the related code.
Hmm, probably a good idea. I guess I'd have to add yet another operand type in RISCVInstrInfo. Checking Operands for "call" or "tail" seems a bit hacky to me, but maybe it's a reasonable approach?
OK, that makes things a lot simpler for LowerCall then. Is there no case where calls need to be lowered using GOT?