Skip to content

Commit 06119fa

Browse files
committed
Fix comment and pull out code into variable.
1 parent cd8e424 commit 06119fa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,7 +3047,7 @@ void PPCAIXAsmPrinter::emitEndOfAsmFile(Module &M) {
30473047
bool PPCAIXAsmPrinter::doInitialization(Module &M) {
30483048
const bool Result = PPCAsmPrinter::doInitialization(M);
30493049

3050-
// Emit .machine directive on AIX.
3050+
// Emit the .machine directive on AIX.
30513051
const Triple &Target = TM.getTargetTriple();
30523052
XCOFF::CFileCpuId TargetCpuId = XCOFF::TCPU_INVALID;
30533053
// Walk through the "target-cpu" attribute of functions and use the newest
@@ -3061,10 +3061,12 @@ bool PPCAIXAsmPrinter::doInitialization(Module &M) {
30613061
// If there is no "target-cpu" attribute within the functions, take the
30623062
// "-mcpu" value. If both are omitted, use getNormalizedPPCTargetCPU() to
30633063
// determine the default CPU.
3064-
if (!TargetCpuId)
3065-
TargetCpuId = XCOFF::getCpuID(TM.getTargetCPU().empty()
3066-
? PPC::getNormalizedPPCTargetCPU(Target)
3067-
: TM.getTargetCPU());
3064+
if (!TargetCpuId) {
3065+
StringRef TargetCPU = TM.getTargetCPU();
3066+
TargetCpuId = XCOFF::getCpuID(
3067+
TargetCPU.empty() ? PPC::getNormalizedPPCTargetCPU(Target) : TargetCPU);
3068+
}
3069+
30683070
PPCTargetStreamer *TS =
30693071
static_cast<PPCTargetStreamer *>(OutStreamer->getTargetStreamer());
30703072
TS->emitMachine(XCOFF::getTCPUString(TargetCpuId));

0 commit comments

Comments
 (0)