summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenPGO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenPGO.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenPGO.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp
index 1f2fe38c40e..86df30e5475 100644
--- a/clang/lib/CodeGen/CodeGenPGO.cpp
+++ b/clang/lib/CodeGen/CodeGenPGO.cpp
@@ -221,25 +221,20 @@ static llvm::Constant *getOrInsertRuntimeWriteAtExit(CodeGenModule &CGM) {
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() {
OpenPOWER on IntegriCloud