[llvm] 59e1fbe - [PowerPC] Fix gcc warning [NFC]
Mikael Holmen via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 25 04:02:16 PDT 2020
Author: Mikael Holmen
Date: 2020-08-25T12:58:38+02:00
New Revision: 59e1fbe55784d236d5a9e55b6da592bbbcff9057
URL: https://github.com/llvm/llvm-project/commit/59e1fbe55784d236d5a9e55b6da592bbbcff9057
DIFF: https://github.com/llvm/llvm-project/commit/59e1fbe55784d236d5a9e55b6da592bbbcff9057.diff
LOG: [PowerPC] Fix gcc warning [NFC]
Without the fix gcc 7.4 warns with
../lib/Target/PowerPC/PPCAsmPrinter.cpp: In member function 'void {anonymous}::PPCAsmPrinter::EmitTlsCall(const llvm::MachineInstr*, llvm::MCSymbolRefExpr::VariantKind)':
../lib/Target/PowerPC/PPCAsmPrinter.cpp:525:53: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
MCInstBuilder(Subtarget->isPPC64() ? Opcode : PPC::BL_TLS)
~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
Added:
Modified:
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index cfcd3b031d17..8f1477012bfd 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -522,7 +522,8 @@ void PPCAsmPrinter::EmitTlsCall(const MachineInstr *MI,
MCSymbol *MOSymbol = getSymbol(GValue);
const MCExpr *SymVar = MCSymbolRefExpr::create(MOSymbol, VK, OutContext);
EmitToStreamer(*OutStreamer,
- MCInstBuilder(Subtarget->isPPC64() ? Opcode : PPC::BL_TLS)
+ MCInstBuilder(Subtarget->isPPC64() ? Opcode
+ : (unsigned)PPC::BL_TLS)
.addExpr(TlsRef)
.addExpr(SymVar));
}
More information about the llvm-commits
mailing list