aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llvm/include/llvm/Pass.h15
-rw-r--r--llvm/lib/IR/Pass.cpp18
2 files changed, 19 insertions, 14 deletions
diff --git a/llvm/include/llvm/Pass.h b/llvm/include/llvm/Pass.h
index 9e1d79dc..921db0b 100644
--- a/llvm/include/llvm/Pass.h
+++ b/llvm/include/llvm/Pass.h
@@ -87,20 +87,7 @@ enum class ThinOrFullLTOPhase {
};
#ifndef NDEBUG
-constexpr const char *to_string(ThinOrFullLTOPhase Phase) {
- switch (Phase) {
- case ThinOrFullLTOPhase::None:
- return "None";
- case ThinOrFullLTOPhase::ThinLTOPreLink:
- return "ThinLTOPreLink";
- case ThinOrFullLTOPhase::ThinLTOPostLink:
- return "ThinLTOPostLink";
- case ThinOrFullLTOPhase::FullLTOPreLink:
- return "FullLTOPreLink";
- case ThinOrFullLTOPhase::FullLTOPostLink:
- return "FullLTOPostLink";
- }
-}
+const char *to_string(ThinOrFullLTOPhase Phase);
#endif
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/IR/Pass.cpp b/llvm/lib/IR/Pass.cpp
index 5701bd7..b1b33a5 100644
--- a/llvm/lib/IR/Pass.cpp
+++ b/llvm/lib/IR/Pass.cpp
@@ -282,3 +282,21 @@ AnalysisUsage &AnalysisUsage::addRequiredTransitiveID(char &ID) {
pushUnique(RequiredTransitive, &ID);
return *this;
}
+
+#ifndef NDEBUG
+const char *llvm::to_string(ThinOrFullLTOPhase Phase) {
+ switch (Phase) {
+ case ThinOrFullLTOPhase::None:
+ return "None";
+ case ThinOrFullLTOPhase::ThinLTOPreLink:
+ return "ThinLTOPreLink";
+ case ThinOrFullLTOPhase::ThinLTOPostLink:
+ return "ThinLTOPostLink";
+ case ThinOrFullLTOPhase::FullLTOPreLink:
+ return "FullLTOPreLink";
+ case ThinOrFullLTOPhase::FullLTOPostLink:
+ return "FullLTOPostLink";
+ }
+ llvm_unreachable("invalid phase");
+}
+#endif