Give internal classes hidden visibility.

Worth 100k on a linux/x86_64 Release+Asserts clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190534 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/IR/AsmWriter.h b/lib/IR/AsmWriter.h
index 8f4a377..9e83557 100644
--- a/lib/IR/AsmWriter.h
+++ b/lib/IR/AsmWriter.h
@@ -39,7 +39,7 @@
 // TypePrinting Class: Type printing machinery
 //===----------------------------------------------------------------------===//
 
-class TypePrinting {
+class LLVM_LIBRARY_VISIBILITY TypePrinting {
   TypePrinting(const TypePrinting &) LLVM_DELETED_FUNCTION;
   void operator=(const TypePrinting&) LLVM_DELETED_FUNCTION;
 public:
@@ -61,7 +61,7 @@
   void printStructBody(StructType *Ty, raw_ostream &OS);
 };
 
-class AssemblyWriter {
+class LLVM_LIBRARY_VISIBILITY AssemblyWriter {
 protected:
   formatted_raw_ostream &Out;
   const Module *TheModule;
diff --git a/lib/IR/AttributeImpl.h b/lib/IR/AttributeImpl.h
index 9da3f96..ac7379b 100644
--- a/lib/IR/AttributeImpl.h
+++ b/lib/IR/AttributeImpl.h
@@ -29,7 +29,7 @@
 /// \class
 /// \brief This class represents a single, uniqued attribute. That attribute
 /// could be a single enum, a tuple, or a string.
-class AttributeImpl : public FoldingSetNode {
+class LLVM_LIBRARY_VISIBILITY AttributeImpl : public FoldingSetNode {
   unsigned char KindID; ///< Holds the AttrEntryKind of the attribute
 
   // AttributesImpl is uniqued, these should not be publicly available.
@@ -93,7 +93,7 @@
 /// represented by Attribute::AttrKind; alignment attribute entries; and string
 /// attribute enties, which are for target-dependent attributes.
 
-class EnumAttributeImpl : public AttributeImpl {
+class LLVM_LIBRARY_VISIBILITY EnumAttributeImpl : public AttributeImpl {
   Attribute::AttrKind Kind;
 
 protected:
@@ -107,7 +107,7 @@
   Attribute::AttrKind getEnumKind() const { return Kind; }
 };
 
-class AlignAttributeImpl : public EnumAttributeImpl {
+class LLVM_LIBRARY_VISIBILITY AlignAttributeImpl : public EnumAttributeImpl {
   unsigned Align;
 
 public:
@@ -121,7 +121,7 @@
   unsigned getAlignment() const { return Align; }
 };
 
-class StringAttributeImpl : public AttributeImpl {
+class LLVM_LIBRARY_VISIBILITY StringAttributeImpl : public AttributeImpl {
   std::string Kind;
   std::string Val;
 
@@ -137,7 +137,7 @@
 /// \class
 /// \brief This class represents a group of attributes that apply to one
 /// element: function, return type, or parameter.
-class AttributeSetNode : public FoldingSetNode {
+class LLVM_LIBRARY_VISIBILITY AttributeSetNode : public FoldingSetNode {
   unsigned NumAttrs; ///< Number of attributes in this node.
 
   AttributeSetNode(ArrayRef<Attribute> Attrs) : NumAttrs(Attrs.size()) {
@@ -180,7 +180,7 @@
 /// \class
 /// \brief This class represents a set of attributes that apply to the function,
 /// return type, and parameters.
-class AttributeSetImpl : public FoldingSetNode {
+class LLVM_LIBRARY_VISIBILITY AttributeSetImpl : public FoldingSetNode {
   friend class AttributeSet;
 
   LLVMContext &Context;
diff --git a/lib/IR/ConstantsContext.h b/lib/IR/ConstantsContext.h
index 32bed95..b4f0a53 100644
--- a/lib/IR/ConstantsContext.h
+++ b/lib/IR/ConstantsContext.h
@@ -31,7 +31,7 @@
 
 /// UnaryConstantExpr - This class is private to Constants.cpp, and is used
 /// behind the scenes to implement unary constant exprs.
-class UnaryConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY UnaryConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -48,7 +48,7 @@
 
 /// BinaryConstantExpr - This class is private to Constants.cpp, and is used
 /// behind the scenes to implement binary constant exprs.
-class BinaryConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY BinaryConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -69,7 +69,7 @@
 
 /// SelectConstantExpr - This class is private to Constants.cpp, and is used
 /// behind the scenes to implement select constant exprs.
-class SelectConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY SelectConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -90,7 +90,7 @@
 /// ExtractElementConstantExpr - This class is private to
 /// Constants.cpp, and is used behind the scenes to implement
 /// extractelement constant exprs.
-class ExtractElementConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY ExtractElementConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -111,7 +111,7 @@
 /// InsertElementConstantExpr - This class is private to
 /// Constants.cpp, and is used behind the scenes to implement
 /// insertelement constant exprs.
-class InsertElementConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY InsertElementConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -133,7 +133,7 @@
 /// ShuffleVectorConstantExpr - This class is private to
 /// Constants.cpp, and is used behind the scenes to implement
 /// shufflevector constant exprs.
-class ShuffleVectorConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY ShuffleVectorConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -158,7 +158,7 @@
 /// ExtractValueConstantExpr - This class is private to
 /// Constants.cpp, and is used behind the scenes to implement
 /// extractvalue constant exprs.
-class ExtractValueConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY ExtractValueConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -184,7 +184,7 @@
 /// InsertValueConstantExpr - This class is private to
 /// Constants.cpp, and is used behind the scenes to implement
 /// insertvalue constant exprs.
-class InsertValueConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY InsertValueConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -211,7 +211,7 @@
 
 /// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
 /// used behind the scenes to implement getelementpr constant exprs.
-class GetElementPtrConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY GetElementPtrConstantExpr : public ConstantExpr {
   virtual void anchor();
   GetElementPtrConstantExpr(Constant *C, ArrayRef<Constant*> IdxList,
                             Type *DestTy);
@@ -232,7 +232,7 @@
 // CompareConstantExpr - This class is private to Constants.cpp, and is used
 // behind the scenes to implement ICmp and FCmp constant expressions. This is
 // needed in order to store the predicate value for these instructions.
-class CompareConstantExpr : public ConstantExpr {
+class LLVM_LIBRARY_VISIBILITY CompareConstantExpr : public ConstantExpr {
   virtual void anchor();
   void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
 public:
@@ -313,7 +313,7 @@
 };
 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(CompareConstantExpr, Value)
 
-struct ExprMapKeyType {
+struct LLVM_LIBRARY_VISIBILITY ExprMapKeyType {
   ExprMapKeyType(unsigned opc,
       ArrayRef<Constant*> ops,
       unsigned short flags = 0,
@@ -349,7 +349,7 @@
   }
 };
 
-struct InlineAsmKeyType {
+struct LLVM_LIBRARY_VISIBILITY InlineAsmKeyType {
   InlineAsmKeyType(StringRef AsmString,
                    StringRef Constraints, bool hasSideEffects,
                    bool isAlignStack, InlineAsm::AsmDialect asmDialect)
@@ -512,7 +512,7 @@
 
 template<class ValType, class ValRefType, class TypeClass, class ConstantClass,
          bool HasLargeKey = false /*true for arrays and structs*/ >
-class ConstantUniqueMap {
+class LLVM_LIBRARY_VISIBILITY ConstantUniqueMap {
 public:
   typedef std::pair<TypeClass*, ValType> MapKey;
   typedef std::map<MapKey, ConstantClass *> MapTy;
@@ -648,7 +648,7 @@
 
 // Unique map for aggregate constants
 template<class TypeClass, class ConstantClass>
-class ConstantAggrUniqueMap {
+class LLVM_LIBRARY_VISIBILITY ConstantAggrUniqueMap {
 public:
   typedef ArrayRef<Constant*> Operands;
   typedef std::pair<TypeClass*, Operands> LookupKey;
diff --git a/lib/IR/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h
index 0c659b8..d566166 100644
--- a/lib/IR/LLVMContextImpl.h
+++ b/lib/IR/LLVMContextImpl.h
@@ -41,7 +41,7 @@
 class Type;
 class Value;
 
-struct DenseMapAPIntKeyInfo {
+struct LLVM_LIBRARY_VISIBILITY DenseMapAPIntKeyInfo {
   struct KeyTy {
     APInt val;
     Type* type;
@@ -66,7 +66,7 @@
   }
 };
 
-struct DenseMapAPFloatKeyInfo {
+struct LLVM_LIBRARY_VISIBILITY DenseMapAPFloatKeyInfo {
   struct KeyTy {
     APFloat val;
     KeyTy(const APFloat& V) : val(V){}
@@ -94,7 +94,7 @@
   }
 };
 
-struct AnonStructTypeKeyInfo {
+struct LLVM_LIBRARY_VISIBILITY AnonStructTypeKeyInfo {
   struct KeyTy {
     ArrayRef<Type*> ETypes;
     bool isPacked;
@@ -138,7 +138,7 @@
   }
 };
 
-struct FunctionTypeKeyInfo {
+struct LLVM_LIBRARY_VISIBILITY FunctionTypeKeyInfo {
   struct KeyTy {
     const Type *ReturnType;
     ArrayRef<Type*> Params;
@@ -209,7 +209,7 @@
 
 /// DebugRecVH - This is a CallbackVH used to keep the Scope -> index maps
 /// up to date as MDNodes mutate.  This class is implemented in DebugLoc.cpp.
-class DebugRecVH : public CallbackVH {
+class LLVM_LIBRARY_VISIBILITY DebugRecVH : public CallbackVH {
   /// Ctx - This is the LLVM Context being referenced.
   LLVMContextImpl *Ctx;
   
@@ -230,7 +230,7 @@
   virtual void allUsesReplacedWith(Value *VNew);
 };
   
-class LLVMContextImpl {
+class LLVM_LIBRARY_VISIBILITY LLVMContextImpl {
 public:
   /// OwnedModules - The set of modules instantiated in this context, and which
   /// will be automatically deleted if this context is deleted.
diff --git a/lib/IR/LeaksContext.h b/lib/IR/LeaksContext.h
index 5038dc9..78cd695 100644
--- a/lib/IR/LeaksContext.h
+++ b/lib/IR/LeaksContext.h
@@ -28,7 +28,7 @@
 };
 
 template <typename T>
-struct LeakDetectorImpl {
+struct LLVM_LIBRARY_VISIBILITY LeakDetectorImpl {
   explicit LeakDetectorImpl(const char* const name = "") : 
     Cache(0), Name(name) { }