[Layering] Sink Linker.h into a Linker subdirectory to make it
authorChandler Carruth <chandlerc@gmail.com>
Thu, 6 Mar 2014 03:42:23 +0000 (03:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 6 Mar 2014 03:42:23 +0000 (03:42 +0000)
consistent with every other sub-library header in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203065 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/LTO/LTOCodeGenerator.h
include/llvm/Linker.h [deleted file]
include/llvm/Linker/Linker.h [new file with mode: 0644]
lib/LTO/LTOCodeGenerator.cpp
lib/Linker/LinkModules.cpp
tools/bugpoint/BugDriver.cpp
tools/bugpoint/Miscompilation.cpp
tools/llvm-link/llvm-link.cpp
unittests/Linker/LinkModulesTest.cpp

index 4836a51a7e7101627a8b99e3925648c6aa54c332..ee2b2088914c4a5f32e75c9898ba05b706b3a1ba 100644 (file)
@@ -39,7 +39,7 @@
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/StringMap.h"
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm/Target/TargetOptions.h"
 #include <string>
 #include <vector>
diff --git a/include/llvm/Linker.h b/include/llvm/Linker.h
deleted file mode 100644 (file)
index 67f6fc1..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-//===- llvm/Linker.h - Module Linker Interface ------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LINKER_H
-#define LLVM_LINKER_H
-
-#include "llvm/ADT/SmallPtrSet.h"
-#include <string>
-
-namespace llvm {
-
-class Module;
-class StringRef;
-class StructType;
-
-/// This class provides the core functionality of linking in LLVM. It keeps a
-/// pointer to the merged module so far. It doesn't take ownership of the
-/// module since it is assumed that the user of this class will want to do
-/// something with it after the linking.
-class Linker {
-  public:
-    enum LinkerMode {
-      DestroySource = 0, // Allow source module to be destroyed.
-      PreserveSource = 1 // Preserve the source module.
-    };
-
-    Linker(Module *M, bool SuppressWarnings=false);
-    ~Linker();
-
-    Module *getModule() const { return Composite; }
-    void deleteModule();
-
-    /// \brief Link \p Src into the composite. The source is destroyed if
-    /// \p Mode is DestroySource and preserved if it is PreserveSource.
-    /// If \p ErrorMsg is not null, information about any error is written
-    /// to it.
-    /// Returns true on error.
-    bool linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg);
-    bool linkInModule(Module *Src, std::string *ErrorMsg) {
-      return linkInModule(Src, Linker::DestroySource, ErrorMsg);
-    }
-
-    static bool LinkModules(Module *Dest, Module *Src, unsigned Mode,
-                            std::string *ErrorMsg);
-
-  private:
-    Module *Composite;
-    SmallPtrSet<StructType*, 32> IdentifiedStructTypes;
-
-    bool SuppressWarnings;
-};
-
-} // End llvm namespace
-
-#endif
diff --git a/include/llvm/Linker/Linker.h b/include/llvm/Linker/Linker.h
new file mode 100644 (file)
index 0000000..42b2cb3
--- /dev/null
@@ -0,0 +1,61 @@
+//===- Linker.h - Module Linker Interface -----------------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LINKER_LINKER_H
+#define LLVM_LINKER_LINKER_H
+
+#include "llvm/ADT/SmallPtrSet.h"
+#include <string>
+
+namespace llvm {
+
+class Module;
+class StringRef;
+class StructType;
+
+/// This class provides the core functionality of linking in LLVM. It keeps a
+/// pointer to the merged module so far. It doesn't take ownership of the
+/// module since it is assumed that the user of this class will want to do
+/// something with it after the linking.
+class Linker {
+  public:
+    enum LinkerMode {
+      DestroySource = 0, // Allow source module to be destroyed.
+      PreserveSource = 1 // Preserve the source module.
+    };
+
+    Linker(Module *M, bool SuppressWarnings=false);
+    ~Linker();
+
+    Module *getModule() const { return Composite; }
+    void deleteModule();
+
+    /// \brief Link \p Src into the composite. The source is destroyed if
+    /// \p Mode is DestroySource and preserved if it is PreserveSource.
+    /// If \p ErrorMsg is not null, information about any error is written
+    /// to it.
+    /// Returns true on error.
+    bool linkInModule(Module *Src, unsigned Mode, std::string *ErrorMsg);
+    bool linkInModule(Module *Src, std::string *ErrorMsg) {
+      return linkInModule(Src, Linker::DestroySource, ErrorMsg);
+    }
+
+    static bool LinkModules(Module *Dest, Module *Src, unsigned Mode,
+                            std::string *ErrorMsg);
+
+  private:
+    Module *Composite;
+    SmallPtrSet<StructType*, 32> IdentifiedStructTypes;
+
+    bool SuppressWarnings;
+};
+
+} // End llvm namespace
+
+#endif
index d6ca41b8df8688f9aa93393a53116f5afda3226a..4e28c328ad8e63f04a685e0b69862e8f6f6418d4 100644 (file)
@@ -29,7 +29,7 @@
 #include "llvm/IR/Verifier.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/LTO/LTOModule.h"
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm/MC/MCAsmInfo.h"
 #include "llvm/MC/MCContext.h"
 #include "llvm/MC/SubtargetFeature.h"
index a0ce497dd4732f109270ce2fa7fc66011f1a167a..c6476ce7b849ce619c8d30b71a8ca4fe97e08e1b 100644 (file)
@@ -11,7 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm-c/Linker.h"
 #include "llvm/ADT/Optional.h"
 #include "llvm/ADT/SetVector.h"
index a5436ba485257c9f2c7b49ac2cab547018d9adbb..c23a7912c759337366b04e0a02e7f6d30f33e258 100644 (file)
@@ -17,7 +17,7 @@
 #include "ToolRunner.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IRReader/IRReader.h"
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FileUtilities.h"
index 069a32af0fdef93672a57c76459888868e3896c9..8aebe5ea83949afde7eaad217a52ac5268817cde 100644 (file)
@@ -21,7 +21,7 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/Verifier.h"
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FileUtilities.h"
index f1b32de04b87ef95888a23536e4b6cf32929220f..14491482870967381dea907e99902bb581db283a 100644 (file)
@@ -12,7 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm/Bitcode/ReaderWriter.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
index 06c00a0504043e4a57de8af9ca0614891a7c8d7f..ef3772d3a736d1117f23fb5df4c80347e73aec57 100644 (file)
@@ -7,7 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "llvm/Linker.h"
+#include "llvm/Linker/Linker.h"
 #include "llvm/IR/BasicBlock.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Function.h"