r204297 - PGO: Separate out common isMachO logic; no functionality change
Duncan P. N. Exon Smith
dexonsmith at apple.com
Wed Mar 19 20:17:15 PDT 2014
Author: dexonsmith
Date: Wed Mar 19 22:17:15 2014
New Revision: 204297
URL: http://llvm.org/viewvc/llvm-project?rev=204297&view=rev
Log:
PGO: Separate out common isMachO logic; no functionality change
<rdar://problem/15943240>
Modified:
cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
Modified: cfe/trunk/lib/CodeGen/CodeGenPGO.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenPGO.cpp?rev=204297&r1=204296&r2=204297&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenPGO.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenPGO.cpp Wed Mar 19 22:17:15 2014
@@ -221,25 +221,20 @@ static llvm::Constant *getOrInsertRuntim
WriteAtExitTy);
}
+static bool isMachO(const CodeGenModule &CGM) {
+ return CGM.getTarget().getTriple().isOSBinFormatMachO();
+}
+
static StringRef getCountersSection(const CodeGenModule &CGM) {
- if (CGM.getTarget().getTriple().isOSBinFormatMachO())
- return "__DATA,__llvm_pgo_cnts";
- else
- return "__llvm_pgo_cnts";
+ return isMachO(CGM) ? "__DATA,__llvm_pgo_cnts" : "__llvm_pgo_cnts";
}
static StringRef getNameSection(const CodeGenModule &CGM) {
- if (CGM.getTarget().getTriple().isOSBinFormatMachO())
- return "__DATA,__llvm_pgo_names";
- else
- return "__llvm_pgo_names";
+ return isMachO(CGM) ? "__DATA,__llvm_pgo_names" : "__llvm_pgo_names";
}
static StringRef getDataSection(const CodeGenModule &CGM) {
- if (CGM.getTarget().getTriple().isOSBinFormatMachO())
- return "__DATA,__llvm_pgo_data";
- else
- return "__llvm_pgo_data";
+ return isMachO(CGM) ? "__DATA,__llvm_pgo_data" : "__llvm_pgo_data";
}
llvm::GlobalVariable *CodeGenPGO::buildDataVar() {
More information about the cfe-commits
mailing list