aboutsummaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorMark Seaborn <mseaborn@chromium.org>2012-10-10 17:44:43 -0700
committerMark Seaborn <mseaborn@chromium.org>2012-10-10 17:44:43 -0700
commit7ef7d6db32b8a009c749a4d4f070cc7a72b1f3ff (patch)
tree8cc55ec3c0a25d7631ec166a2654585e3d5b540d /include/llvm
parentff0566a629426809a704bc118c149dca569a5614 (diff)
PNaCl: Add a pass to convert llvm.global_ctors to __init_array_start/end
This pass converts LLVM's special symbols llvm.global_ctors and llvm.global_dtors to concrete arrays, __init_array_start/end and __fini_array_start/end, that are usable by a C library. The pass sorts the contents of global_ctors/dtors according to the priority values they contain and removes the priority values. This pass will allow us to simplify the PNaCl ABI so that less is done at translation time. BUG= http://code.google.com/p/nativeclient/issues/detail?id=3018 TEST=test/Transforms/NaCl/expand-ctors*.ll Review URL: https://codereview.chromium.org/10977030
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/InitializePasses.h1
-rw-r--r--include/llvm/Transforms/NaCl.h21
2 files changed, 22 insertions, 0 deletions
diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h
index 4c93d480dd..87899fc360 100644
--- a/include/llvm/InitializePasses.h
+++ b/include/llvm/InitializePasses.h
@@ -261,6 +261,7 @@ void initializeUnpackMachineBundlesPass(PassRegistry&);
void initializeFinalizeMachineBundlesPass(PassRegistry&);
void initializeBBVectorizePass(PassRegistry&);
void initializeMachineFunctionPrinterPassPass(PassRegistry&);
+void initializeExpandCtorsPass(PassRegistry&); // @LOCALMOD
void initializeNaClCcRewritePass(PassRegistry&); // @LOCALMOD
}
diff --git a/include/llvm/Transforms/NaCl.h b/include/llvm/Transforms/NaCl.h
new file mode 100644
index 0000000000..fe29463a8b
--- /dev/null
+++ b/include/llvm/Transforms/NaCl.h
@@ -0,0 +1,21 @@
+//===-- NaCl.h - NaCl Transformations ---------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_TRANSFORMS_NACL_H
+#define LLVM_TRANSFORMS_NACL_H
+
+namespace llvm {
+
+class ModulePass;
+
+ModulePass *createExpandCtorsPass();
+
+}
+
+#endif