mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-19 18:24:00 +00:00
Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10131 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -26,8 +26,7 @@
|
|||||||
#include "Support/PostOrderIterator.h"
|
#include "Support/PostOrderIterator.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define SC_DEBUG(X) std::cerr << X
|
#define SC_DEBUG(X) std::cerr << X
|
||||||
@ -363,5 +362,3 @@ int SlotCalculator::doInsertValue(const Value *D) {
|
|||||||
SC_DEBUG("]\n");
|
SC_DEBUG("]\n");
|
||||||
return (int)DestSlot;
|
return (int)DestSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -32,8 +32,7 @@
|
|||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
static RegisterPass<PrintModulePass>
|
static RegisterPass<PrintModulePass>
|
||||||
X("printm", "Print module to stderr",PassInfo::Analysis|PassInfo::Optimization);
|
X("printm", "Print module to stderr",PassInfo::Analysis|PassInfo::Optimization);
|
||||||
@ -233,7 +232,7 @@ static std::ostream &printTypeInt(std::ostream &Out, const Type *Ty,
|
|||||||
// type, iff there is an entry in the modules symbol table for the specified
|
// type, iff there is an entry in the modules symbol table for the specified
|
||||||
// type or one of it's component types. This is slower than a simple x << Type;
|
// type or one of it's component types. This is slower than a simple x << Type;
|
||||||
//
|
//
|
||||||
std::ostream &WriteTypeSymbolic(std::ostream &Out, const Type *Ty,
|
std::ostream &llvm::WriteTypeSymbolic(std::ostream &Out, const Type *Ty,
|
||||||
const Module *M) {
|
const Module *M) {
|
||||||
Out << " ";
|
Out << " ";
|
||||||
|
|
||||||
@ -447,7 +446,8 @@ static void WriteAsOperandInternal(std::ostream &Out, const Value *V,
|
|||||||
// ostream. This can be useful when you just want to print int %reg126, not the
|
// ostream. This can be useful when you just want to print int %reg126, not the
|
||||||
// whole instruction that generated it.
|
// whole instruction that generated it.
|
||||||
//
|
//
|
||||||
std::ostream &WriteAsOperand(std::ostream &Out, const Value *V, bool PrintType,
|
std::ostream &llvm::WriteAsOperand(std::ostream &Out, const Value *V,
|
||||||
|
bool PrintType,
|
||||||
bool PrintName, const Module *Context) {
|
bool PrintName, const Module *Context) {
|
||||||
std::map<const Type *, std::string> TypeNames;
|
std::map<const Type *, std::string> TypeNames;
|
||||||
if (Context == 0) Context = getModuleFromVal(V);
|
if (Context == 0) Context = getModuleFromVal(V);
|
||||||
@ -465,7 +465,7 @@ std::ostream &WriteAsOperand(std::ostream &Out, const Value *V, bool PrintType,
|
|||||||
return Out;
|
return Out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
|
|
||||||
class AssemblyWriter {
|
class AssemblyWriter {
|
||||||
std::ostream &Out;
|
std::ostream &Out;
|
||||||
@ -520,7 +520,7 @@ private :
|
|||||||
// which slot it occupies.
|
// which slot it occupies.
|
||||||
void printInfoComment(const Value &V);
|
void printInfoComment(const Value &V);
|
||||||
};
|
};
|
||||||
|
} // end of anonymous namespace
|
||||||
|
|
||||||
// printTypeAtLeastOneLevel - Print out one level of the possibly complex type
|
// printTypeAtLeastOneLevel - Print out one level of the possibly complex type
|
||||||
// without considering any symbolic types that we may have equal to it.
|
// without considering any symbolic types that we may have equal to it.
|
||||||
@ -1063,5 +1063,3 @@ CachedWriter &CachedWriter::operator<<(const Value *V) {
|
|||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
ConstantBool *ConstantBool::True = new ConstantBool(true);
|
ConstantBool *ConstantBool::True = new ConstantBool(true);
|
||||||
ConstantBool *ConstantBool::False = new ConstantBool(false);
|
ConstantBool *ConstantBool::False = new ConstantBool(false);
|
||||||
@ -540,6 +539,7 @@ void ConstantExpr::replaceUsesOfWithOnConstant(Value *From, Value *ToV,
|
|||||||
// something strange that needs to be done to interface to the ctor for the
|
// something strange that needs to be done to interface to the ctor for the
|
||||||
// constant.
|
// constant.
|
||||||
//
|
//
|
||||||
|
namespace llvm {
|
||||||
template<class ConstantClass, class TypeClass, class ValType>
|
template<class ConstantClass, class TypeClass, class ValType>
|
||||||
struct ConstantCreator {
|
struct ConstantCreator {
|
||||||
static ConstantClass *create(const TypeClass *Ty, const ValType &V) {
|
static ConstantClass *create(const TypeClass *Ty, const ValType &V) {
|
||||||
@ -554,6 +554,7 @@ struct ConvertConstantType {
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<class ValType, class TypeClass, class ConstantClass>
|
template<class ValType, class TypeClass, class ConstantClass>
|
||||||
@ -712,7 +713,7 @@ ConstantFP *ConstantFP::get(const Type *Ty, double V) {
|
|||||||
|
|
||||||
//---- ConstantArray::get() implementation...
|
//---- ConstantArray::get() implementation...
|
||||||
//
|
//
|
||||||
|
namespace llvm {
|
||||||
template<>
|
template<>
|
||||||
struct ConvertConstantType<ConstantArray, ArrayType> {
|
struct ConvertConstantType<ConstantArray, ArrayType> {
|
||||||
static void convert(ConstantArray *OldC, const ArrayType *NewTy) {
|
static void convert(ConstantArray *OldC, const ArrayType *NewTy) {
|
||||||
@ -726,7 +727,7 @@ struct ConvertConstantType<ConstantArray, ArrayType> {
|
|||||||
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static ValueMap<std::vector<Constant*>, ArrayType,
|
static ValueMap<std::vector<Constant*>, ArrayType,
|
||||||
ConstantArray> ArrayConstants;
|
ConstantArray> ArrayConstants;
|
||||||
@ -778,6 +779,7 @@ std::string ConstantArray::getAsString() const {
|
|||||||
//---- ConstantStruct::get() implementation...
|
//---- ConstantStruct::get() implementation...
|
||||||
//
|
//
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
template<>
|
template<>
|
||||||
struct ConvertConstantType<ConstantStruct, StructType> {
|
struct ConvertConstantType<ConstantStruct, StructType> {
|
||||||
static void convert(ConstantStruct *OldC, const StructType *NewTy) {
|
static void convert(ConstantStruct *OldC, const StructType *NewTy) {
|
||||||
@ -792,6 +794,7 @@ struct ConvertConstantType<ConstantStruct, StructType> {
|
|||||||
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static ValueMap<std::vector<Constant*>, StructType,
|
static ValueMap<std::vector<Constant*>, StructType,
|
||||||
ConstantStruct> StructConstants;
|
ConstantStruct> StructConstants;
|
||||||
@ -811,6 +814,7 @@ void ConstantStruct::destroyConstant() {
|
|||||||
//---- ConstantPointerNull::get() implementation...
|
//---- ConstantPointerNull::get() implementation...
|
||||||
//
|
//
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
// ConstantPointerNull does not take extra "value" argument...
|
// ConstantPointerNull does not take extra "value" argument...
|
||||||
template<class ValType>
|
template<class ValType>
|
||||||
struct ConstantCreator<ConstantPointerNull, PointerType, ValType> {
|
struct ConstantCreator<ConstantPointerNull, PointerType, ValType> {
|
||||||
@ -829,6 +833,7 @@ struct ConvertConstantType<ConstantPointerNull, PointerType> {
|
|||||||
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static ValueMap<char, PointerType, ConstantPointerNull> NullPtrConstants;
|
static ValueMap<char, PointerType, ConstantPointerNull> NullPtrConstants;
|
||||||
|
|
||||||
@ -865,6 +870,7 @@ void ConstantPointerRef::destroyConstant() {
|
|||||||
//
|
//
|
||||||
typedef std::pair<unsigned, std::vector<Constant*> > ExprMapKeyType;
|
typedef std::pair<unsigned, std::vector<Constant*> > ExprMapKeyType;
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
template<>
|
template<>
|
||||||
struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
|
struct ConstantCreator<ConstantExpr, Type, ExprMapKeyType> {
|
||||||
static ConstantExpr *create(const Type *Ty, const ExprMapKeyType &V) {
|
static ConstantExpr *create(const Type *Ty, const ExprMapKeyType &V) {
|
||||||
@ -915,6 +921,7 @@ struct ConvertConstantType<ConstantExpr, Type> {
|
|||||||
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
OldC->destroyConstant(); // This constant is now dead, destroy it.
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
} // end namespace llvm
|
||||||
|
|
||||||
|
|
||||||
static ValueMap<ExprMapKeyType, Type, ConstantExpr> ExprConstants;
|
static ValueMap<ExprMapKeyType, Type, ConstantExpr> ExprConstants;
|
||||||
@ -1039,4 +1046,3 @@ unsigned Constant::mutateReferences(Value *OldV, Value *NewV) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
#include "llvm/Assembly/Writer.h"
|
#include "llvm/Assembly/Writer.h"
|
||||||
#include "Support/DepthFirstIterator.h"
|
#include "Support/DepthFirstIterator.h"
|
||||||
#include "Support/SetOperations.h"
|
#include "Support/SetOperations.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// DominatorSet Implementation
|
// DominatorSet Implementation
|
||||||
@ -120,7 +119,7 @@ void DominatorSet::recalculate() {
|
|||||||
for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) Doms[I];
|
for (Function::iterator I = F->begin(), E = F->end(); I != E; ++I) Doms[I];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace llvm {
|
||||||
static std::ostream &operator<<(std::ostream &o,
|
static std::ostream &operator<<(std::ostream &o,
|
||||||
const std::set<BasicBlock*> &BBs) {
|
const std::set<BasicBlock*> &BBs) {
|
||||||
for (std::set<BasicBlock*>::const_iterator I = BBs.begin(), E = BBs.end();
|
for (std::set<BasicBlock*>::const_iterator I = BBs.begin(), E = BBs.end();
|
||||||
@ -131,6 +130,7 @@ static std::ostream &operator<<(std::ostream &o,
|
|||||||
o << " <<exit node>>";
|
o << " <<exit node>>";
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DominatorSetBase::print(std::ostream &o) const {
|
void DominatorSetBase::print(std::ostream &o) const {
|
||||||
for (const_iterator I = begin(), E = end(); I != E; ++I) {
|
for (const_iterator I = begin(), E = end(); I != E; ++I) {
|
||||||
@ -361,4 +361,3 @@ void DominanceFrontierBase::print(std::ostream &o) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -18,8 +18,7 @@
|
|||||||
#include "llvm/Intrinsics.h"
|
#include "llvm/Intrinsics.h"
|
||||||
#include "Support/LeakDetector.h"
|
#include "Support/LeakDetector.h"
|
||||||
#include "SymbolTableListTraitsImpl.h"
|
#include "SymbolTableListTraitsImpl.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
BasicBlock *ilist_traits<BasicBlock>::createNode() {
|
BasicBlock *ilist_traits<BasicBlock>::createNode() {
|
||||||
BasicBlock *Ret = new BasicBlock();
|
BasicBlock *Ret = new BasicBlock();
|
||||||
@ -259,5 +258,3 @@ void GlobalVariable::setName(const std::string &name, SymbolTable *ST) {
|
|||||||
Value::setName(name);
|
Value::setName(name);
|
||||||
if (P && getName() != "") P->getSymbolTable().insert(this);
|
if (P && getName() != "") P->getSymbolTable().insert(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -21,8 +21,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
Function *ilist_traits<Function>::createNode() {
|
Function *ilist_traits<Function>::createNode() {
|
||||||
FunctionType *FTy =
|
FunctionType *FTy =
|
||||||
@ -55,11 +54,13 @@ template class SymbolTableListTraits<Function, Module, Module>;
|
|||||||
// Define the GlobalValueRefMap as a struct that wraps a map so that we don't
|
// Define the GlobalValueRefMap as a struct that wraps a map so that we don't
|
||||||
// have Module.h depend on <map>
|
// have Module.h depend on <map>
|
||||||
//
|
//
|
||||||
|
namespace llvm {
|
||||||
struct GlobalValueRefMap {
|
struct GlobalValueRefMap {
|
||||||
typedef std::map<GlobalValue*, ConstantPointerRef*> MapTy;
|
typedef std::map<GlobalValue*, ConstantPointerRef*> MapTy;
|
||||||
typedef MapTy::iterator iterator;
|
typedef MapTy::iterator iterator;
|
||||||
std::map<GlobalValue*, ConstantPointerRef*> Map;
|
std::map<GlobalValue*, ConstantPointerRef*> Map;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Module::Module(const std::string &MID)
|
Module::Module(const std::string &MID)
|
||||||
@ -310,4 +311,3 @@ void Module::mutateConstantPointerRef(GlobalValue *OldGV, GlobalValue *NewGV) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -13,8 +13,7 @@
|
|||||||
|
|
||||||
#include "llvm/ModuleProvider.h"
|
#include "llvm/ModuleProvider.h"
|
||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
/// ctor - always have a valid Module
|
/// ctor - always have a valid Module
|
||||||
///
|
///
|
||||||
@ -37,5 +36,3 @@ Module* ModuleProvider::materializeModule() {
|
|||||||
|
|
||||||
return TheModule;
|
return TheModule;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -20,8 +20,7 @@
|
|||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include "Support/TypeInfo.h"
|
#include "Support/TypeInfo.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
// IncludeFile - Stub function used to help linking out.
|
// IncludeFile - Stub function used to help linking out.
|
||||||
IncludeFile::IncludeFile(void*) {}
|
IncludeFile::IncludeFile(void*) {}
|
||||||
@ -469,5 +468,3 @@ void PassRegistrationListener::enumeratePasses() {
|
|||||||
E = PassInfoMap->end(); I != E; ++I)
|
E = PassInfoMap->end(); I != E; ++I)
|
||||||
passEnumerate(I->second);
|
passEnumerate(I->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -26,8 +26,7 @@
|
|||||||
#include "Support/PostOrderIterator.h"
|
#include "Support/PostOrderIterator.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
#define SC_DEBUG(X) std::cerr << X
|
#define SC_DEBUG(X) std::cerr << X
|
||||||
@ -363,5 +362,3 @@ int SlotCalculator::doInsertValue(const Value *D) {
|
|||||||
SC_DEBUG("]\n");
|
SC_DEBUG("]\n");
|
||||||
return (int)DestSlot;
|
return (int)DestSlot;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -16,8 +16,7 @@
|
|||||||
#include "llvm/Module.h"
|
#include "llvm/Module.h"
|
||||||
#include "Support/StringExtras.h"
|
#include "Support/StringExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
#define DEBUG_SYMBOL_TABLE 0
|
#define DEBUG_SYMBOL_TABLE 0
|
||||||
#define DEBUG_ABSTYPE 0
|
#define DEBUG_ABSTYPE 0
|
||||||
@ -363,5 +362,3 @@ void SymbolTable::dump() const {
|
|||||||
std::cout << "Symbol table dump:\n";
|
std::cout << "Symbol table dump:\n";
|
||||||
for_each(begin(), end(), DumpPlane);
|
for_each(begin(), end(), DumpPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -17,8 +17,7 @@
|
|||||||
#include "llvm/Constant.h"
|
#include "llvm/Constant.h"
|
||||||
#include "Support/LeakDetector.h"
|
#include "Support/LeakDetector.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Value Class
|
// Value Class
|
||||||
@ -109,5 +108,3 @@ void User::replaceUsesOfWith(Value *From, Value *To) {
|
|||||||
setOperand(i, To); // Fix it now...
|
setOperand(i, To); // Fix it now...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -57,8 +57,7 @@
|
|||||||
#include "llvm/Support/InstVisitor.h"
|
#include "llvm/Support/InstVisitor.h"
|
||||||
#include "Support/STLExtras.h"
|
#include "Support/STLExtras.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
using namespace llvm;
|
||||||
namespace llvm {
|
|
||||||
|
|
||||||
namespace { // Anonymous namespace for class
|
namespace { // Anonymous namespace for class
|
||||||
|
|
||||||
@ -158,9 +157,11 @@ namespace { // Anonymous namespace for class
|
|||||||
|
|
||||||
void WriteValue(const Value *V) {
|
void WriteValue(const Value *V) {
|
||||||
if (!V) return;
|
if (!V) return;
|
||||||
if (isa<Instruction>(V))
|
if (isa<Instruction>(V)) {
|
||||||
std::cerr << *V;
|
std::cerr << *V;
|
||||||
else {
|
} else if (const Type *Ty = dyn_cast<Type>(V)) {
|
||||||
|
WriteTypeSymbolic(std::cerr, Ty, Mod);
|
||||||
|
} else {
|
||||||
WriteAsOperand (std::cerr, V, true, true, Mod);
|
WriteAsOperand (std::cerr, V, true, true, Mod);
|
||||||
std::cerr << "\n";
|
std::cerr << "\n";
|
||||||
}
|
}
|
||||||
@ -184,6 +185,8 @@ namespace { // Anonymous namespace for class
|
|||||||
};
|
};
|
||||||
|
|
||||||
RegisterOpt<Verifier> X("verify", "Module Verifier");
|
RegisterOpt<Verifier> X("verify", "Module Verifier");
|
||||||
|
} // End anonymous namespace
|
||||||
|
|
||||||
|
|
||||||
// Assert - We know that cond should be true, if not print an error message.
|
// Assert - We know that cond should be true, if not print an error message.
|
||||||
#define Assert(C, M) \
|
#define Assert(C, M) \
|
||||||
@ -569,19 +572,18 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
|
|||||||
"Illegal # arguments for intrinsic function!", IF);
|
"Illegal # arguments for intrinsic function!", IF);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End anonymous namespace
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Implement the public interfaces to this file...
|
// Implement the public interfaces to this file...
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
FunctionPass *createVerifierPass() {
|
FunctionPass *llvm::createVerifierPass() {
|
||||||
return new Verifier();
|
return new Verifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// verifyFunction - Create
|
// verifyFunction - Create
|
||||||
bool verifyFunction(const Function &f) {
|
bool llvm::verifyFunction(const Function &f) {
|
||||||
Function &F = (Function&)f;
|
Function &F = (Function&)f;
|
||||||
assert(!F.isExternal() && "Cannot verify external functions");
|
assert(!F.isExternal() && "Cannot verify external functions");
|
||||||
|
|
||||||
@ -600,12 +602,10 @@ bool verifyFunction(const Function &f) {
|
|||||||
// verifyModule - Check a module for errors, printing messages on stderr.
|
// verifyModule - Check a module for errors, printing messages on stderr.
|
||||||
// Return true if the module is corrupt.
|
// Return true if the module is corrupt.
|
||||||
//
|
//
|
||||||
bool verifyModule(const Module &M) {
|
bool llvm::verifyModule(const Module &M) {
|
||||||
PassManager PM;
|
PassManager PM;
|
||||||
Verifier *V = new Verifier();
|
Verifier *V = new Verifier();
|
||||||
PM.add(V);
|
PM.add(V);
|
||||||
PM.run((Module&)M);
|
PM.run((Module&)M);
|
||||||
return V->Broken;
|
return V->Broken;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End llvm namespace
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
#include "llvm/iMemory.h"
|
#include "llvm/iMemory.h"
|
||||||
#include "llvm/Constants.h"
|
#include "llvm/Constants.h"
|
||||||
#include "llvm/DerivedTypes.h"
|
#include "llvm/DerivedTypes.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
|
AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
|
||||||
|
Reference in New Issue
Block a user