[PATCH] D24670: Fix unresolved linker symbols from misplaced extern definitions

Chuck Atkins via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 30 06:42:51 PDT 2016


chuckatkins updated this revision to Diff 73043.
chuckatkins added a comment.

Adjusted code style with clang-format


https://reviews.llvm.org/D24670

Files:
  lib/Transforms/Utils/LoopUtils.cpp


Index: lib/Transforms/Utils/LoopUtils.cpp
===================================================================
--- lib/Transforms/Utils/LoopUtils.cpp
+++ lib/Transforms/Utils/LoopUtils.cpp
@@ -929,6 +929,13 @@
   return UsedOutside;
 }
 
+// We locally access their IDs for LoopSimplify and LCSSA here because
+// users shouldn't directly get them from this header.
+namespace llvm {
+extern char &LoopSimplifyID;
+extern char &LCSSAID;
+}
+
 void llvm::getLoopAnalysisUsage(AnalysisUsage &AU) {
   // By definition, all loop passes need the LoopInfo analysis and the
   // Dominator tree it depends on. Because they all participate in the loop
@@ -938,10 +945,7 @@
   AU.addRequired<LoopInfoWrapperPass>();
   AU.addPreserved<LoopInfoWrapperPass>();
 
-  // We must also preserve LoopSimplify and LCSSA. We locally access their IDs
-  // here because users shouldn't directly get them from this header.
-  extern char &LoopSimplifyID;
-  extern char &LCSSAID;
+  // We must also preserve LoopSimplify and LCSSA.
   AU.addRequiredID(LoopSimplifyID);
   AU.addPreservedID(LoopSimplifyID);
   AU.addRequiredID(LCSSAID);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24670.73043.patch
Type: text/x-patch
Size: 1117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160930/49b07f77/attachment.bin>


More information about the llvm-commits mailing list