aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Transforms/Utils/NameAnonGlobals.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Transforms/Utils/NameAnonGlobals.h')
-rw-r--r--include/llvm/Transforms/Utils/NameAnonGlobals.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/NameAnonGlobals.h b/include/llvm/Transforms/Utils/NameAnonGlobals.h
new file mode 100644
index 0000000000000..4bec361674bb4
--- /dev/null
+++ b/include/llvm/Transforms/Utils/NameAnonGlobals.h
@@ -0,0 +1,31 @@
+//===-- NameAnonGlobals.h - Anonymous Global Naming Pass ----*- C++ -*-=======//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements naming anonymous globals to make sure they can be
+// referred to by ThinLTO.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_UTILS_NAMEANONGLOBALSS_H
+#define LLVM_TRANSFORMS_UTILS_NAMEANONGLOBALSS_H
+
+#include "llvm/IR/Module.h"
+#include "llvm/IR/PassManager.h"
+
+namespace llvm {
+
+/// Simple pass that provides a name to every anonymous globals.
+class NameAnonGlobalPass : public PassInfoMixin<NameAnonGlobalPass> {
+public:
+ NameAnonGlobalPass() {}
+ PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
+};
+}
+
+#endif // LLVM_TRANSFORMS_UTILS_NAMEANONGLOBALS_H