#include "llvm/Function.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/Visibility.h"
#include <limits>
#include <cmath>
using namespace llvm;
namespace {
- struct ConstRules {
+ struct VISIBILITY_HIDDEN ConstRules {
ConstRules() {}
virtual ~ConstRules() {}
//
namespace {
template<class ArgType, class SubClassName>
-class TemplateRules : public ConstRules {
+class VISIBILITY_HIDDEN TemplateRules : public ConstRules {
//===--------------------------------------------------------------------===//
// EmptyRules provides a concrete base class of ConstRules that does nothing
//
namespace {
-struct EmptyRules : public TemplateRules<Constant, EmptyRules> {
+struct VISIBILITY_HIDDEN EmptyRules
+ : public TemplateRules<Constant, EmptyRules> {
static Constant *EqualTo(const Constant *V1, const Constant *V2) {
if (V1 == V2) return ConstantBool::True;
return 0;
// BoolRules provides a concrete base class of ConstRules for the 'bool' type.
//
namespace {
-struct BoolRules : public TemplateRules<ConstantBool, BoolRules> {
+struct VISIBILITY_HIDDEN BoolRules
+ : public TemplateRules<ConstantBool, BoolRules> {
static Constant *LessThan(const ConstantBool *V1, const ConstantBool *V2) {
return ConstantBool::get(V1->getValue() < V2->getValue());
// pointers.
//
namespace {
-struct NullPointerRules : public TemplateRules<ConstantPointerNull,
- NullPointerRules> {
+struct VISIBILITY_HIDDEN NullPointerRules
+ : public TemplateRules<ConstantPointerNull, NullPointerRules> {
static Constant *EqualTo(const Constant *V1, const Constant *V2) {
return ConstantBool::True; // Null pointers are always equal
}
/// ConstantPacked operands.
///
namespace {
-struct ConstantPackedRules
+struct VISIBILITY_HIDDEN ConstantPackedRules
: public TemplateRules<ConstantPacked, ConstantPackedRules> {
static Constant *Add(const ConstantPacked *V1, const ConstantPacked *V2) {
/// cause for this is that one operand is a ConstantAggregateZero.
///
namespace {
-struct GeneralPackedRules : public TemplateRules<Constant, GeneralPackedRules> {
+struct VISIBILITY_HIDDEN GeneralPackedRules
+ : public TemplateRules<Constant, GeneralPackedRules> {
};
} // end anonymous namespace
//
namespace {
template<class ConstantClass, class BuiltinType, Type **Ty, class SuperClass>
-struct DirectRules : public TemplateRules<ConstantClass, SuperClass> {
+struct VISIBILITY_HIDDEN DirectRules
+ : public TemplateRules<ConstantClass, SuperClass> {
static Constant *Add(const ConstantClass *V1, const ConstantClass *V2) {
BuiltinType R = (BuiltinType)V1->getValue() + (BuiltinType)V2->getValue();
return ConstantClass::get(*Ty, R);
//
namespace {
template <class ConstantClass, class BuiltinType, Type **Ty>
-struct DirectIntRules
+struct VISIBILITY_HIDDEN DirectIntRules
: public DirectRules<ConstantClass, BuiltinType, Ty,
DirectIntRules<ConstantClass, BuiltinType, Ty> > {
///
namespace {
template <class ConstantClass, class BuiltinType, Type **Ty>
-struct DirectFPRules
+struct VISIBILITY_HIDDEN DirectFPRules
: public DirectRules<ConstantClass, BuiltinType, Ty,
DirectFPRules<ConstantClass, BuiltinType, Ty> > {
static Constant *Rem(const ConstantClass *V1, const ConstantClass *V2) {
dyn_cast<PointerType>(CE->getOperand(0)->getType()))
if (const ArrayType *SAT = dyn_cast<ArrayType>(SPT->getElementType()))
if (const ArrayType *CAT =
- dyn_cast<ArrayType>(cast<PointerType>(C->getType())->getElementType()))
+ dyn_cast<ArrayType>(cast<PointerType>(C->getType())->getElementType()))
if (CAT->getElementType() == SAT->getElementType())
return ConstantExpr::getGetElementPtr(
(Constant*)CE->getOperand(0), IdxList);
#include "llvm/Module.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/Visibility.h"
#include <algorithm>
#include <iostream>
using namespace llvm;
/// UnaryConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement unary constant exprs.
-class UnaryConstantExpr : public ConstantExpr {
+namespace {
+class VISIBILITY_HIDDEN UnaryConstantExpr : public ConstantExpr {
Use Op;
public:
UnaryConstantExpr(unsigned Opcode, Constant *C, const Type *Ty)
: ConstantExpr(Ty, Opcode, &Op, 1), Op(C, this) {}
};
+}
static bool isSetCC(unsigned Opcode) {
return Opcode == Instruction::SetEQ || Opcode == Instruction::SetNE ||
/// BinaryConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement binary constant exprs.
-class BinaryConstantExpr : public ConstantExpr {
+namespace {
+class VISIBILITY_HIDDEN BinaryConstantExpr : public ConstantExpr {
Use Ops[2];
public:
BinaryConstantExpr(unsigned Opcode, Constant *C1, Constant *C2)
Ops[1].init(C2, this);
}
};
+}
/// SelectConstantExpr - This class is private to Constants.cpp, and is used
/// behind the scenes to implement select constant exprs.
-class SelectConstantExpr : public ConstantExpr {
+namespace {
+class VISIBILITY_HIDDEN SelectConstantExpr : public ConstantExpr {
Use Ops[3];
public:
SelectConstantExpr(Constant *C1, Constant *C2, Constant *C3)
Ops[2].init(C3, this);
}
};
+}
/// ExtractElementConstantExpr - This class is private to
/// Constants.cpp, and is used behind the scenes to implement
/// extractelement constant exprs.
-class ExtractElementConstantExpr : public ConstantExpr {
+namespace {
+class VISIBILITY_HIDDEN ExtractElementConstantExpr : public ConstantExpr {
Use Ops[2];
public:
ExtractElementConstantExpr(Constant *C1, Constant *C2)
Ops[1].init(C2, this);
}
};
+}
/// InsertElementConstantExpr - This class is private to
/// Constants.cpp, and is used behind the scenes to implement
/// insertelement constant exprs.
-class InsertElementConstantExpr : public ConstantExpr {
+namespace {
+class VISIBILITY_HIDDEN InsertElementConstantExpr : public ConstantExpr {
Use Ops[3];
public:
InsertElementConstantExpr(Constant *C1, Constant *C2, Constant *C3)
Ops[2].init(C3, this);
}
};
+}
/// ShuffleVectorConstantExpr - This class is private to
/// Constants.cpp, and is used behind the scenes to implement
/// shufflevector constant exprs.
-class ShuffleVectorConstantExpr : public ConstantExpr {
+namespace {
+class VISIBILITY_HIDDEN ShuffleVectorConstantExpr : public ConstantExpr {
Use Ops[3];
public:
ShuffleVectorConstantExpr(Constant *C1, Constant *C2, Constant *C3)
Ops[2].init(C3, this);
}
};
+}
/// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
/// used behind the scenes to implement getelementpr constant exprs.
-struct GetElementPtrConstantExpr : public ConstantExpr {
+namespace {
+struct VISIBILITY_HIDDEN GetElementPtrConstantExpr : public ConstantExpr {
GetElementPtrConstantExpr(Constant *C, const std::vector<Constant*> &IdxList,
const Type *DestTy)
: ConstantExpr(DestTy, Instruction::GetElementPtr,
delete [] OperandList;
}
};
+}
/// ConstantExpr::get* - Return some common constants without having to
/// specify the full Instruction::OPCODE identifier.
//
namespace llvm {
template<class ConstantClass, class TypeClass, class ValType>
- struct ConstantCreator {
+ struct VISIBILITY_HIDDEN ConstantCreator {
static ConstantClass *create(const TypeClass *Ty, const ValType &V) {
return new ConstantClass(Ty, V);
}
};
template<class ConstantClass, class TypeClass>
- struct ConvertConstantType {
+ struct VISIBILITY_HIDDEN ConvertConstantType {
static void convert(ConstantClass *OldC, const TypeClass *NewTy) {
assert(0 && "This type cannot be converted!\n");
abort();
namespace {
template<class ValType, class TypeClass, class ConstantClass,
bool HasLargeKey = false /*true for arrays and structs*/ >
- class ValueMap : public AbstractTypeUser {
+ class VISIBILITY_HIDDEN ValueMap : public AbstractTypeUser {
public:
typedef std::pair<const TypeClass*, ValType> MapKey;
typedef std::map<MapKey, ConstantClass *> MapTy;
#include "llvm/ADT/SCCIterator.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/Visibility.h"
#include <algorithm>
#include <iostream>
using namespace llvm;
//===----------------------------------------------------------------------===//
namespace {
- struct PrimType : public Type {
+ struct VISIBILITY_HIDDEN PrimType : public Type {
PrimType(const char *S, TypeID ID) : Type(S, ID) {}
};
}
#include "llvm/Support/InstVisitor.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/Support/Visibility.h"
#include <algorithm>
#include <iostream>
#include <sstream>
namespace { // Anonymous namespace for class
- struct Verifier : public FunctionPass, InstVisitor<Verifier> {
+ struct VISIBILITY_HIDDEN
+ Verifier : public FunctionPass, InstVisitor<Verifier> {
bool Broken; // Is this module found to be broken?
bool RealPass; // Are we not being run by a PassManager?
VerifierFailureAction action;