[llvm] 23f144e - [NFC] Add extra documentation for GetSymbolFromOperand() in PPCMCInstLower.cpp
Amy Kwan via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 19:08:37 PDT 2023
Author: Amy Kwan
Date: 2023-09-07T21:01:28-05:00
New Revision: 23f144ec1c014fb26a98cff407d2d83b50f11baf
URL: https://github.com/llvm/llvm-project/commit/23f144ec1c014fb26a98cff407d2d83b50f11baf
DIFF: https://github.com/llvm/llvm-project/commit/23f144ec1c014fb26a98cff407d2d83b50f11baf.diff
LOG: [NFC] Add extra documentation for GetSymbolFromOperand() in PPCMCInstLower.cpp
Add a missing comment from D155600, where we note that we get the symbol
from a global, due to XCOFF-specific intricacies.
Added:
Modified:
llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
index ba5465f8bb6edcd..c9797fdc22863df 100644
--- a/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp
@@ -32,6 +32,8 @@ using namespace llvm;
static MCSymbol *GetSymbolFromOperand(const MachineOperand &MO,
AsmPrinter &AP) {
if (MO.isGlobal()) {
+ // Get the symbol from the global, accounting for XCOFF-specific
+ // intricacies (see TargetLoweringObjectFileXCOFF::getTargetSymbol).
const GlobalValue *GV = MO.getGlobal();
return AP.getSymbol(GV);
}
More information about the llvm-commits
mailing list