aboutsummaryrefslogtreecommitdiff
path: root/lld/Common/CommonLinkerContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/Common/CommonLinkerContext.cpp')
-rw-r--r--lld/Common/CommonLinkerContext.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lld/Common/CommonLinkerContext.cpp b/lld/Common/CommonLinkerContext.cpp
index 50ccbb37c796..12f56bc10ec9 100644
--- a/lld/Common/CommonLinkerContext.cpp
+++ b/lld/Common/CommonLinkerContext.cpp
@@ -10,6 +10,8 @@
#include "lld/Common/ErrorHandler.h"
#include "lld/Common/Memory.h"
+#include "llvm/CodeGen/CommandFlags.h"
+
using namespace llvm;
using namespace lld;
@@ -20,7 +22,11 @@ using namespace lld;
// state.
static CommonLinkerContext *lctx;
-CommonLinkerContext::CommonLinkerContext() { lctx = this; }
+CommonLinkerContext::CommonLinkerContext() {
+ lctx = this;
+ // Fire off the static initializations in CGF's constructor.
+ codegen::RegisterCodeGenFlags CGF;
+}
CommonLinkerContext::~CommonLinkerContext() {
assert(lctx);