summaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-07-26 16:18:00 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-07-26 16:18:00 +0000
commit7107c3badfe78ec89dcab6c02cf1b1bcaccc42a8 (patch)
tree9ef4b2b152223b366915fdfd0a572f2c7ef7f9cb /include/llvm
parent8884060a258729fadcfbd7433082e50c25291f8a (diff)
downloadllvm-7107c3badfe78ec89dcab6c02cf1b1bcaccc42a8.tar.gz
llvm-7107c3badfe78ec89dcab6c02cf1b1bcaccc42a8.tar.bz2
llvm-7107c3badfe78ec89dcab6c02cf1b1bcaccc42a8.tar.xz
For PR780:
1. Move IncludeFile.h to System library 2. Move IncludeFile.cpp to System library 3. #1 and #2 required to prevent cyclic library dependencies for libSystem 4. Convert all existing uses of Support/IncludeFile.h to System/IncludeFile.h 5. Add IncludeFile support to various lib/System classes. 6. Add new lib/System classes to LinkAllVMCore.h All this in an attempt to pull in lib/System to what's required for VMCore git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Analysis/AliasAnalysis.h2
-rw-r--r--include/llvm/InlineAsm.h2
-rw-r--r--include/llvm/IntrinsicInst.h2
-rw-r--r--include/llvm/LinkAllVMCore.h10
-rw-r--r--include/llvm/PassSupport.h2
-rw-r--r--include/llvm/Support/Dwarf.h4
-rw-r--r--include/llvm/Support/IncludeFile.h65
-rw-r--r--include/llvm/Support/Mangler.h2
-rw-r--r--include/llvm/Support/MathExtras.h4
-rw-r--r--include/llvm/Support/SlowOperationInformer.h3
-rw-r--r--include/llvm/System/IncludeFile.h6
-rw-r--r--include/llvm/System/Memory.h3
-rw-r--r--include/llvm/System/Mutex.h4
13 files changed, 34 insertions, 75 deletions
diff --git a/include/llvm/Analysis/AliasAnalysis.h b/include/llvm/Analysis/AliasAnalysis.h
index 2fff77420a..66f60ab547 100644
--- a/include/llvm/Analysis/AliasAnalysis.h
+++ b/include/llvm/Analysis/AliasAnalysis.h
@@ -31,7 +31,7 @@
#define LLVM_ANALYSIS_ALIAS_ANALYSIS_H
#include "llvm/Support/CallSite.h"
-#include "llvm/Support/IncludeFile.h"
+#include "llvm/System/IncludeFile.h"
namespace llvm {
diff --git a/include/llvm/InlineAsm.h b/include/llvm/InlineAsm.h
index 6e7aab1cb0..b9f707cf83 100644
--- a/include/llvm/InlineAsm.h
+++ b/include/llvm/InlineAsm.h
@@ -17,7 +17,7 @@
#define LLVM_INLINEASM_H
#include "llvm/Value.h"
-#include "llvm/Support/IncludeFile.h"
+#include "llvm/System/IncludeFile.h"
#include <vector>
namespace llvm {
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h
index 5b784fc2b9..996c83cb8e 100644
--- a/include/llvm/IntrinsicInst.h
+++ b/include/llvm/IntrinsicInst.h
@@ -28,7 +28,7 @@
#include "llvm/Function.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
-#include "llvm/Support/IncludeFile.h"
+#include "llvm/System/IncludeFile.h"
namespace llvm {
/// IntrinsicInst - A useful wrapper class for inspecting calls to intrinsic
diff --git a/include/llvm/LinkAllVMCore.h b/include/llvm/LinkAllVMCore.h
index d0366ebe1e..fa46dbb1f1 100644
--- a/include/llvm/LinkAllVMCore.h
+++ b/include/llvm/LinkAllVMCore.h
@@ -16,13 +16,19 @@
#ifndef LLVM_LINKALLVMCORE_H
#define LLVM_LINKALLVMCORE_H
-#include "llvm/Support/IncludeFile.h"
-#include "llvm/Support/Mangler.h"
+#include "llvm/System/IncludeFile.h"
+
#include "llvm/Module.h"
#include "llvm/Instructions.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/InlineAsm.h"
#include "llvm/Analysis/Verifier.h"
+#include "llvm/System/Memory.h"
+#include "llvm/System/Mutex.h"
+#include "llvm/Support/Dwarf.h"
+#include "llvm/Support/Mangler.h"
+#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/SlowOperationInformer.h"
namespace {
struct ForceVMCoreLinking {
diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h
index 57dcce7950..9350e284fc 100644
--- a/include/llvm/PassSupport.h
+++ b/include/llvm/PassSupport.h
@@ -21,7 +21,7 @@
#ifndef LLVM_PASS_SUPPORT_H
#define LLVM_PASS_SUPPORT_H
-#include "llvm/Support/IncludeFile.h"
+#include "llvm/System/IncludeFile.h"
// No need to include Pass.h, we are being included by it!
namespace llvm {
diff --git a/include/llvm/Support/Dwarf.h b/include/llvm/Support/Dwarf.h
index 17622f4515..05260be2d7 100644
--- a/include/llvm/Support/Dwarf.h
+++ b/include/llvm/Support/Dwarf.h
@@ -16,6 +16,8 @@
#ifndef LLVM_SUPPORT_DWARF_H
#define LLVM_SUPPORT_DWARF_H
+#include "llvm/System/IncludeFile.h"
+
namespace llvm {
namespace dwarf {
@@ -546,4 +548,6 @@ const char *CallFrameString(unsigned Encoding);
} // End of namespace llvm
+FORCE_DEFINING_FILE_TO_BE_LINKED(SupportDwarf)
+
#endif
diff --git a/include/llvm/Support/IncludeFile.h b/include/llvm/Support/IncludeFile.h
deleted file mode 100644
index 798c6b454f..0000000000
--- a/include/llvm/Support/IncludeFile.h
+++ /dev/null
@@ -1,65 +0,0 @@
-//===- llvm/Support/IncludeFile.h - Ensure Linking Of Library ---*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file was developed by Reid Spencer and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the FORCE_DEFINING_FILE_TO_BE_LINKED and DEFINE_FILE_FOR
-// macros.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_INCLUDEFILE_H
-#define LLVM_SUPPORT_INCLUDEFILE_H
-
-/// This macro is the public interface that IncludeFile.h exports. This gives
-/// us the option to implement the "link the definition" capability in any
-/// manner that we choose. All header files that depend on a specific .cpp
-/// file being linked at run time should use this macro instead of the
-/// IncludeFile class directly.
-///
-/// For example, foo.h would use:<br/>
-/// <tt>FORCE_DEFINING_FILE_TO_BE_LINKED(foo)</tt><br/>
-///
-/// And, foo.cp would use:<br/>
-/// <tt>DEFINING_FILE_FOR(foo)</tt><br/>
-#define FORCE_DEFINING_FILE_TO_BE_LINKED(name) \
- namespace llvm { \
- extern char name ## LinkVar; \
- static IncludeFile name ## LinkObj ( &name ## LinkVar ); \
- }
-
-/// This macro is the counterpart to FORCE_DEFINING_FILE_TO_BE_LINKED. It should
-/// be used in a .cpp file to define the name referenced in a header file that
-/// will cause linkage of the .cpp file. It should only be used at extern level.
-#define DEFINING_FILE_FOR(name) namespace llvm { char name ## LinkVar; }
-
-namespace llvm {
-
-/// This class is used in the implementation of FORCE_DEFINING_FILE_TO_BE_LINKED
-/// macro to make sure that the implementation of a header file is included
-/// into a tool that uses the header. This is solely
-/// to overcome problems linking .a files and not getting the implementation
-/// of compilation units we need. This is commonly an issue with the various
-/// Passes but also occurs elsewhere in LLVM. We like to use .a files because
-/// they link faster and provide the smallest executables. However, sometimes
-/// those executables are too small, if the program doesn't reference something
-/// that might be needed, especially by a loaded share object. This little class
-/// helps to resolve that problem. The basic strategy is to use this class in
-/// a header file and pass the address of a variable to the constructor. If the
-/// variable is defined in the header file's corresponding .cpp file then all
-/// tools/libraries that #include the header file will require the .cpp as well.
-/// For example:<br/>
-/// <tt>extern int LinkMyCodeStub;</tt><br/>
-/// <tt>static IncludeFile LinkMyModule(&LinkMyCodeStub);</tt><br/>
-/// @brief Class to ensure linking of corresponding object file.
-struct IncludeFile {
- IncludeFile(void *);
-};
-
-}
-
-#endif
diff --git a/include/llvm/Support/Mangler.h b/include/llvm/Support/Mangler.h
index 50e49ff8a5..ac7deadf8b 100644
--- a/include/llvm/Support/Mangler.h
+++ b/include/llvm/Support/Mangler.h
@@ -14,7 +14,7 @@
#ifndef LLVM_SUPPORT_MANGLER_H
#define LLVM_SUPPORT_MANGLER_H
-#include "llvm/Support/IncludeFile.h"
+#include "llvm/System/IncludeFile.h"
#include <map>
#include <set>
#include <string>
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h
index 0f5961ff73..228d35ceff 100644
--- a/include/llvm/Support/MathExtras.h
+++ b/include/llvm/Support/MathExtras.h
@@ -15,6 +15,7 @@
#define LLVM_SUPPORT_MATHEXTRAS_H
#include "llvm/Support/DataTypes.h"
+#include "llvm/System/IncludeFile.h"
namespace llvm {
@@ -306,4 +307,7 @@ int IsInf (double d);
} // End llvm namespace
+FORCE_DEFINING_FILE_TO_BE_LINKED(SupportIsInf)
+FORCE_DEFINING_FILE_TO_BE_LINKED(SupportIsNAN)
+
#endif
diff --git a/include/llvm/Support/SlowOperationInformer.h b/include/llvm/Support/SlowOperationInformer.h
index d05792672a..0be01960ca 100644
--- a/include/llvm/Support/SlowOperationInformer.h
+++ b/include/llvm/Support/SlowOperationInformer.h
@@ -32,6 +32,7 @@
#include <string>
#include <cassert>
#include "llvm/Support/DataTypes.h"
+#include "llvm/System/IncludeFile.h"
namespace llvm {
class SlowOperationInformer {
@@ -63,3 +64,5 @@ namespace llvm {
} // end namespace llvm
#endif /* SLOW_OPERATION_INFORMER_H */
+
+FORCE_DEFINING_FILE_TO_BE_LINKED(SupportSlowOperationInformer)
diff --git a/include/llvm/System/IncludeFile.h b/include/llvm/System/IncludeFile.h
index 798c6b454f..c9f3882359 100644
--- a/include/llvm/System/IncludeFile.h
+++ b/include/llvm/System/IncludeFile.h
@@ -1,4 +1,4 @@
-//===- llvm/Support/IncludeFile.h - Ensure Linking Of Library ---*- C++ -*-===//
+//===- llvm/System/IncludeFile.h - Ensure Linking Of Library ---*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -12,8 +12,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_SUPPORT_INCLUDEFILE_H
-#define LLVM_SUPPORT_INCLUDEFILE_H
+#ifndef LLVM_SYSTEM_INCLUDEFILE_H
+#define LLVM_SYSTEM_INCLUDEFILE_H
/// This macro is the public interface that IncludeFile.h exports. This gives
/// us the option to implement the "link the definition" capability in any
diff --git a/include/llvm/System/Memory.h b/include/llvm/System/Memory.h
index 27d7c0cb5c..c343177e17 100644
--- a/include/llvm/System/Memory.h
+++ b/include/llvm/System/Memory.h
@@ -15,6 +15,7 @@
#define LLVM_SYSTEM_MEMORY_H
#include <string>
+#include "llvm/System/IncludeFile.h"
namespace llvm {
namespace sys {
@@ -70,4 +71,6 @@ namespace sys {
}
}
+FORCE_DEFINING_FILE_TO_BE_LINKED(SystemMemory)
+
#endif
diff --git a/include/llvm/System/Mutex.h b/include/llvm/System/Mutex.h
index 94dd811378..27bcea18d3 100644
--- a/include/llvm/System/Mutex.h
+++ b/include/llvm/System/Mutex.h
@@ -14,6 +14,8 @@
#ifndef LLVM_SYSTEM_MUTEX_H
#define LLVM_SYSTEM_MUTEX_H
+#include "llvm/System/IncludeFile.h"
+
namespace llvm
{
namespace sys
@@ -81,4 +83,6 @@ namespace llvm
}
}
+FORCE_DEFINING_FILE_TO_BE_LINKED(SystemMutex)
+
#endif