summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorBrian Gaeke <gaeke@uiuc.edu>2003-11-11 22:41:34 +0000
committerBrian Gaeke <gaeke@uiuc.edu>2003-11-11 22:41:34 +0000
commitd0fde30ce850b78371fd1386338350591f9ff494 (patch)
tree83bb73e83f54fc8e1e474d116250ae2779562f7e /lib/VMCore
parent0d723acf15b0326e2df09ecb614b02a617f536e4 (diff)
downloadllvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.gz
llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.bz2
llvm-d0fde30ce850b78371fd1386338350591f9ff494.tar.xz
Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/AsmWriter.cpp4
-rw-r--r--lib/VMCore/BasicBlock.cpp6
-rw-r--r--lib/VMCore/ConstantFold.cpp4
-rw-r--r--lib/VMCore/ConstantFold.h6
-rw-r--r--lib/VMCore/ConstantFolding.h6
-rw-r--r--lib/VMCore/ConstantRange.cpp4
-rw-r--r--lib/VMCore/Constants.cpp4
-rw-r--r--lib/VMCore/Dominators.cpp4
-rw-r--r--lib/VMCore/Function.cpp50
-rw-r--r--lib/VMCore/InstrTypes.cpp4
-rw-r--r--lib/VMCore/Instruction.cpp4
-rw-r--r--lib/VMCore/LeakDetector.cpp4
-rw-r--r--lib/VMCore/Linker.cpp3
-rw-r--r--lib/VMCore/Mangler.cpp3
-rw-r--r--lib/VMCore/Module.cpp4
-rw-r--r--lib/VMCore/ModuleProvider.cpp4
-rw-r--r--lib/VMCore/Pass.cpp4
-rw-r--r--lib/VMCore/PassManagerT.h5
-rw-r--r--lib/VMCore/SlotCalculator.cpp4
-rw-r--r--lib/VMCore/SymbolTable.cpp4
-rw-r--r--lib/VMCore/SymbolTableListTraitsImpl.h4
-rw-r--r--lib/VMCore/Type.cpp3
-rw-r--r--lib/VMCore/Value.cpp4
-rw-r--r--lib/VMCore/Verifier.cpp60
-rw-r--r--lib/VMCore/iBranch.cpp4
-rw-r--r--lib/VMCore/iCall.cpp7
-rw-r--r--lib/VMCore/iMemory.cpp2
-rw-r--r--lib/VMCore/iOperators.cpp4
-rw-r--r--lib/VMCore/iSwitch.cpp4
29 files changed, 171 insertions, 52 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index c9c4dde7e8..67ccdd0f8d 100644
--- a/lib/VMCore/AsmWriter.cpp
+++ b/lib/VMCore/AsmWriter.cpp
@@ -33,6 +33,8 @@
#include "Support/STLExtras.h"
#include <algorithm>
+namespace llvm {
+
static RegisterPass<PrintModulePass>
X("printm", "Print module to stderr",PassInfo::Analysis|PassInfo::Optimization);
static RegisterPass<PrintFunctionPass>
@@ -1052,3 +1054,5 @@ CachedWriter &CachedWriter::operator<<(const Value *V) {
}
return *this;
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index 2458cda203..63a722b33e 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/lib/VMCore/BasicBlock.cpp
@@ -22,6 +22,8 @@
#include "SymbolTableListTraitsImpl.h"
#include <algorithm>
+namespace llvm {
+
// DummyInst - An instance of this class is used to mark the end of the
// instruction list. This is not a real instruction.
//
@@ -141,7 +143,7 @@ void BasicBlock::dropAllReferences() {
//
bool BasicBlock::hasConstantReferences() const {
for (use_const_iterator I = use_begin(), E = use_end(); I != E; ++I)
- if (::isa<Constant>((Value*)*I))
+ if (isa<Constant>((Value*)*I))
return true;
return false;
@@ -263,3 +265,5 @@ BasicBlock *BasicBlock::splitBasicBlock(iterator I, const std::string &BBName) {
}
return New;
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp
index 32b9ebba74..7fb7a05e55 100644
--- a/lib/VMCore/ConstantFold.cpp
+++ b/lib/VMCore/ConstantFold.cpp
@@ -17,6 +17,8 @@
#include "llvm/DerivedTypes.h"
#include <cmath>
+namespace llvm {
+
AnnotationID ConstRules::AID(AnnotationManager::getID("opt::ConstRules",
&ConstRules::find));
@@ -638,3 +640,5 @@ ConstRules *ConstRules::getConstantExprRules() {
static EmptyRules CERules;
return &CERules;
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/ConstantFold.h b/lib/VMCore/ConstantFold.h
index a27283c440..a0a01e5306 100644
--- a/lib/VMCore/ConstantFold.h
+++ b/lib/VMCore/ConstantFold.h
@@ -42,6 +42,9 @@
#include "llvm/Constants.h"
#include "llvm/Type.h"
+
+namespace llvm {
+
class PointerType;
//===----------------------------------------------------------------------===//
@@ -244,4 +247,7 @@ Constant *ConstantFoldShiftInstruction(unsigned Opcode, const Constant *V1,
const Constant *V2);
Constant *ConstantFoldGetElementPtr(const Constant *C,
const std::vector<Constant*> &IdxList);
+
+} // End llvm namespace
+
#endif
diff --git a/lib/VMCore/ConstantFolding.h b/lib/VMCore/ConstantFolding.h
index a27283c440..a0a01e5306 100644
--- a/lib/VMCore/ConstantFolding.h
+++ b/lib/VMCore/ConstantFolding.h
@@ -42,6 +42,9 @@
#include "llvm/Constants.h"
#include "llvm/Type.h"
+
+namespace llvm {
+
class PointerType;
//===----------------------------------------------------------------------===//
@@ -244,4 +247,7 @@ Constant *ConstantFoldShiftInstruction(unsigned Opcode, const Constant *V1,
const Constant *V2);
Constant *ConstantFoldGetElementPtr(const Constant *C,
const std::vector<Constant*> &IdxList);
+
+} // End llvm namespace
+
#endif
diff --git a/lib/VMCore/ConstantRange.cpp b/lib/VMCore/ConstantRange.cpp
index a9e1204de5..e180f12a1a 100644
--- a/lib/VMCore/ConstantRange.cpp
+++ b/lib/VMCore/ConstantRange.cpp
@@ -26,6 +26,8 @@
#include "llvm/Instruction.h"
#include "llvm/ConstantHandling.h"
+namespace llvm {
+
/// Initialize a full (the default) or empty set for the specified type.
///
ConstantRange::ConstantRange(const Type *Ty, bool Full) {
@@ -248,3 +250,5 @@ void ConstantRange::print(std::ostream &OS) const {
void ConstantRange::dump() const {
print(std::cerr);
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index 28cc9d24e0..527eff5490 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -20,6 +20,8 @@
#include "Support/StringExtras.h"
#include <algorithm>
+namespace llvm {
+
ConstantBool *ConstantBool::True = new ConstantBool(true);
ConstantBool *ConstantBool::False = new ConstantBool(false);
@@ -1029,3 +1031,5 @@ unsigned Constant::mutateReferences(Value *OldV, Value *NewV) {
return NumReplaced;
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/Dominators.cpp b/lib/VMCore/Dominators.cpp
index c3bce78b5a..cad66853c9 100644
--- a/lib/VMCore/Dominators.cpp
+++ b/lib/VMCore/Dominators.cpp
@@ -20,6 +20,8 @@
#include "Support/DepthFirstIterator.h"
#include "Support/SetOperations.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// DominatorSet Implementation
//===----------------------------------------------------------------------===//
@@ -358,3 +360,5 @@ void DominanceFrontierBase::print(std::ostream &o) const {
o << " is:\t" << I->second << "\n";
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp
index f47ecea7af..364cc6f733 100644
--- a/lib/VMCore/Function.cpp
+++ b/lib/VMCore/Function.cpp
@@ -19,6 +19,8 @@
#include "Support/LeakDetector.h"
#include "SymbolTableListTraitsImpl.h"
+namespace llvm {
+
BasicBlock *ilist_traits<BasicBlock>::createNode() {
BasicBlock *Ret = new BasicBlock();
// This should not be garbage monitored.
@@ -158,7 +160,7 @@ void Function::dropAllReferences() {
}
/// getIntrinsicID - This method returns the ID number of the specified
-/// function, or LLVMIntrinsic::not_intrinsic if the function is not an
+/// function, or Intrinsic::not_intrinsic if the function is not an
/// intrinsic, or if the pointer is null. This value is always defined to be
/// zero to allow easy checking for whether a function is intrinsic or not. The
/// particular intrinsic functions which correspond to this value are defined in
@@ -176,21 +178,21 @@ unsigned Function::getIntrinsicID() const {
std::string name; // The name of the intrinsic
unsigned id; // Its ID number
} alpha_intrinsics[] = {
- { "llvm.alpha.ctlz", LLVMIntrinsic::alpha_ctlz },
- { "llvm.alpha.cttz", LLVMIntrinsic::alpha_cttz },
- { "llvm.alpha.ctpop", LLVMIntrinsic::alpha_ctpop },
- { "llvm.alpha.umulh", LLVMIntrinsic::alpha_umulh },
- { "llvm.alpha.vecop", LLVMIntrinsic::alpha_vecop },
- { "llvm.alpha.pup", LLVMIntrinsic::alpha_pup },
- { "llvm.alpha.bytezap", LLVMIntrinsic::alpha_bytezap },
- { "llvm.alpha.bytemanip", LLVMIntrinsic::alpha_bytemanip },
- { "llvm.alpha.dfp_bop", LLVMIntrinsic::alpha_dfpbop },
- { "llvm.alpha.dfp_uop", LLVMIntrinsic::alpha_dfpuop },
- { "llvm.alpha.unordered", LLVMIntrinsic::alpha_unordered },
- { "llvm.alpha.uqtodfp", LLVMIntrinsic::alpha_uqtodfp },
- { "llvm.alpha.uqtosfp", LLVMIntrinsic::alpha_uqtosfp },
- { "llvm.alpha.dfptosq", LLVMIntrinsic::alpha_dfptosq },
- { "llvm.alpha.sfptosq", LLVMIntrinsic::alpha_sfptosq },
+ { "llvm.alpha.ctlz", Intrinsic::alpha_ctlz },
+ { "llvm.alpha.cttz", Intrinsic::alpha_cttz },
+ { "llvm.alpha.ctpop", Intrinsic::alpha_ctpop },
+ { "llvm.alpha.umulh", Intrinsic::alpha_umulh },
+ { "llvm.alpha.vecop", Intrinsic::alpha_vecop },
+ { "llvm.alpha.pup", Intrinsic::alpha_pup },
+ { "llvm.alpha.bytezap", Intrinsic::alpha_bytezap },
+ { "llvm.alpha.bytemanip", Intrinsic::alpha_bytemanip },
+ { "llvm.alpha.dfp_bop", Intrinsic::alpha_dfpbop },
+ { "llvm.alpha.dfp_uop", Intrinsic::alpha_dfpuop },
+ { "llvm.alpha.unordered", Intrinsic::alpha_unordered },
+ { "llvm.alpha.uqtodfp", Intrinsic::alpha_uqtodfp },
+ { "llvm.alpha.uqtosfp", Intrinsic::alpha_uqtosfp },
+ { "llvm.alpha.dfptosq", Intrinsic::alpha_dfptosq },
+ { "llvm.alpha.sfptosq", Intrinsic::alpha_sfptosq },
};
const unsigned num_alpha_intrinsics =
sizeof(alpha_intrinsics) / sizeof(*alpha_intrinsics);
@@ -204,17 +206,17 @@ unsigned Function::getIntrinsicID() const {
return alpha_intrinsics[i].id;
break;
case 'l':
- if (getName() == "llvm.longjmp") return LLVMIntrinsic::longjmp;
+ if (getName() == "llvm.longjmp") return Intrinsic::longjmp;
break;
case 's':
- if (getName() == "llvm.setjmp") return LLVMIntrinsic::setjmp;
- if (getName() == "llvm.sigsetjmp") return LLVMIntrinsic::sigsetjmp;
- if (getName() == "llvm.siglongjmp") return LLVMIntrinsic::siglongjmp;
+ if (getName() == "llvm.setjmp") return Intrinsic::setjmp;
+ if (getName() == "llvm.sigsetjmp") return Intrinsic::sigsetjmp;
+ if (getName() == "llvm.siglongjmp") return Intrinsic::siglongjmp;
break;
case 'v':
- if (getName() == "llvm.va_copy") return LLVMIntrinsic::va_copy;
- if (getName() == "llvm.va_end") return LLVMIntrinsic::va_end;
- if (getName() == "llvm.va_start") return LLVMIntrinsic::va_start;
+ if (getName() == "llvm.va_copy") return Intrinsic::va_copy;
+ if (getName() == "llvm.va_end") return Intrinsic::va_end;
+ if (getName() == "llvm.va_start") return Intrinsic::va_start;
break;
}
// The "llvm." namespace is reserved!
@@ -257,3 +259,5 @@ void GlobalVariable::setName(const std::string &name, SymbolTable *ST) {
Value::setName(name);
if (P && getName() != "") P->getSymbolTable().insert(this);
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/InstrTypes.cpp b/lib/VMCore/InstrTypes.cpp
index ba1d4b7160..17e16fa733 100644
--- a/lib/VMCore/InstrTypes.cpp
+++ b/lib/VMCore/InstrTypes.cpp
@@ -19,6 +19,8 @@
#include "llvm/Type.h"
#include <algorithm> // find
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// TerminatorInst Class
//===----------------------------------------------------------------------===//
@@ -56,3 +58,5 @@ Value *PHINode::removeIncomingValue(unsigned Idx, bool DeletePHIIfEmpty) {
}
return Removed;
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/Instruction.cpp b/lib/VMCore/Instruction.cpp
index b72656bdc2..9ca2fedbf4 100644
--- a/lib/VMCore/Instruction.cpp
+++ b/lib/VMCore/Instruction.cpp
@@ -16,6 +16,8 @@
#include "llvm/Type.h"
#include "Support/LeakDetector.h"
+namespace llvm {
+
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name,
Instruction *InsertBefore)
: User(ty, Value::InstructionVal, Name) {
@@ -163,3 +165,5 @@ bool Instruction::isTrapping(unsigned op) {
return false;
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/LeakDetector.cpp b/lib/VMCore/LeakDetector.cpp
index 24c946ab6e..ffb081a998 100644
--- a/lib/VMCore/LeakDetector.cpp
+++ b/lib/VMCore/LeakDetector.cpp
@@ -15,6 +15,8 @@
#include "llvm/Value.h"
#include <set>
+namespace llvm {
+
// Lazily allocate set so that release build doesn't have to do anything.
static std::set<const void*> *Objects = 0;
static std::set<const Value*> *LLVMObjects = 0;
@@ -87,3 +89,5 @@ void LeakDetector::checkForGarbageImpl(const std::string &Message) {
Objects = 0; LLVMObjects = 0;
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp
index 0be840fb6c..4bc78a4cde 100644
--- a/lib/VMCore/Linker.cpp
+++ b/lib/VMCore/Linker.cpp
@@ -23,6 +23,8 @@
#include "llvm/iOther.h"
#include "llvm/Constants.h"
+namespace llvm {
+
// Error - Simple wrapper function to conditionally assign to E and return true.
// This just makes error return conditions a little bit simpler...
//
@@ -902,3 +904,4 @@ bool LinkModules(Module *Dest, const Module *Src, std::string *ErrorMsg) {
return false;
}
+} // End llvm namespace
diff --git a/lib/VMCore/Mangler.cpp b/lib/VMCore/Mangler.cpp
index 44c697d3d8..567fe05e32 100644
--- a/lib/VMCore/Mangler.cpp
+++ b/lib/VMCore/Mangler.cpp
@@ -16,6 +16,8 @@
#include "llvm/Type.h"
#include "Support/StringExtras.h"
+namespace llvm {
+
static char HexDigit(int V) {
return V < 10 ? V+'0' : V+'A'-10;
}
@@ -99,3 +101,4 @@ Mangler::Mangler(Module &m, bool addUnderscorePrefix)
FoundNames.insert(I->getName()); // Otherwise, keep track of name
}
+} // End llvm namespace
diff --git a/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp
index e62c83f67a..6b15929506 100644
--- a/lib/VMCore/Module.cpp
+++ b/lib/VMCore/Module.cpp
@@ -22,6 +22,8 @@
#include <cstdarg>
#include <map>
+namespace llvm {
+
Function *ilist_traits<Function>::createNode() {
FunctionType *FTy =
FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
@@ -307,3 +309,5 @@ void Module::mutateConstantPointerRef(GlobalValue *OldGV, GlobalValue *NewGV) {
delete Ref;
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/ModuleProvider.cpp b/lib/VMCore/ModuleProvider.cpp
index ba324d0894..8be033622d 100644
--- a/lib/VMCore/ModuleProvider.cpp
+++ b/lib/VMCore/ModuleProvider.cpp
@@ -14,6 +14,8 @@
#include "llvm/ModuleProvider.h"
#include "llvm/Module.h"
+namespace llvm {
+
/// ctor - always have a valid Module
///
ModuleProvider::ModuleProvider() : TheModule(0) { }
@@ -35,3 +37,5 @@ Module* ModuleProvider::materializeModule() {
return TheModule;
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp
index 96ad3c94e9..b387fc3524 100644
--- a/lib/VMCore/Pass.cpp
+++ b/lib/VMCore/Pass.cpp
@@ -21,6 +21,8 @@
#include "Support/TypeInfo.h"
#include <set>
+namespace llvm {
+
// IncludeFile - Stub function used to help linking out.
IncludeFile::IncludeFile(void*) {}
@@ -467,3 +469,5 @@ void PassRegistrationListener::enumeratePasses() {
E = PassInfoMap->end(); I != E; ++I)
passEnumerate(I->second);
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/PassManagerT.h b/lib/VMCore/PassManagerT.h
index a715f5148e..c5cac1d7fe 100644
--- a/lib/VMCore/PassManagerT.h
+++ b/lib/VMCore/PassManagerT.h
@@ -28,6 +28,9 @@
#include "Support/Timer.h"
#include <algorithm>
#include <iostream>
+
+namespace llvm {
+
class Annotable;
//===----------------------------------------------------------------------===//
@@ -792,4 +795,6 @@ inline bool PassManagerTraits<Function>::doFinalization(Module &M) {
return Changed;
}
+} // End llvm namespace
+
#endif
diff --git a/lib/VMCore/SlotCalculator.cpp b/lib/VMCore/SlotCalculator.cpp
index aef71763c4..c6e44e8266 100644
--- a/lib/VMCore/SlotCalculator.cpp
+++ b/lib/VMCore/SlotCalculator.cpp
@@ -27,6 +27,8 @@
#include "Support/STLExtras.h"
#include <algorithm>
+namespace llvm {
+
#if 0
#define SC_DEBUG(X) std::cerr << X
#else
@@ -361,3 +363,5 @@ int SlotCalculator::doInsertValue(const Value *D) {
SC_DEBUG("]\n");
return (int)DestSlot;
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/SymbolTable.cpp b/lib/VMCore/SymbolTable.cpp
index 9452cdfec4..834d619898 100644
--- a/lib/VMCore/SymbolTable.cpp
+++ b/lib/VMCore/SymbolTable.cpp
@@ -17,6 +17,8 @@
#include "Support/StringExtras.h"
#include <algorithm>
+namespace llvm {
+
#define DEBUG_SYMBOL_TABLE 0
#define DEBUG_ABSTYPE 0
@@ -354,3 +356,5 @@ void SymbolTable::dump() const {
std::cout << "Symbol table dump:\n";
for_each(begin(), end(), DumpPlane);
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/SymbolTableListTraitsImpl.h b/lib/VMCore/SymbolTableListTraitsImpl.h
index aec7520cef..22d2e1d6c7 100644
--- a/lib/VMCore/SymbolTableListTraitsImpl.h
+++ b/lib/VMCore/SymbolTableListTraitsImpl.h
@@ -19,6 +19,8 @@
#include "llvm/SymbolTableListTraits.h"
#include "llvm/SymbolTable.h"
+namespace llvm {
+
template<typename ValueSubClass, typename ItemParentClass,typename SymTabClass,
typename SubClass>
void SymbolTableListTraits<ValueSubClass,ItemParentClass,SymTabClass,SubClass>
@@ -94,4 +96,6 @@ void SymbolTableListTraits<ValueSubClass,ItemParentClass,SymTabClass,SubClass>
}
}
+} // End llvm namespace
+
#endif
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp
index ed468022cb..9e33303b7f 100644
--- a/lib/VMCore/Type.cpp
+++ b/lib/VMCore/Type.cpp
@@ -18,6 +18,8 @@
#include "Support/STLExtras.h"
#include <algorithm>
+namespace llvm {
+
// DEBUG_MERGE_TYPES - Enable this #define to see how and when derived types are
// created and later destroyed, all in an effort to make sure that there is only
// a single canonical version of a type.
@@ -1114,3 +1116,4 @@ void PointerType::typeBecameConcrete(const DerivedType *AbsTy) {
refineAbstractType(AbsTy, AbsTy);
}
+} // End llvm namespace
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 709ae3e9ae..f389eb0132 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -18,6 +18,8 @@
#include "Support/LeakDetector.h"
#include <algorithm>
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// Value Class
//===----------------------------------------------------------------------===//
@@ -107,3 +109,5 @@ void User::replaceUsesOfWith(Value *From, Value *To) {
setOperand(i, To); // Fix it now...
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 14c14f3c08..1362eaab0f 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -57,6 +57,8 @@
#include "Support/STLExtras.h"
#include <algorithm>
+namespace llvm {
+
namespace { // Anonymous namespace for class
struct Verifier : public FunctionPass, InstVisitor<Verifier> {
@@ -149,7 +151,7 @@ namespace { // Anonymous namespace for class
void visitReturnInst(ReturnInst &RI);
void visitUserOp1(Instruction &I);
void visitUserOp2(Instruction &I) { visitUserOp1(I); }
- void visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI);
+ void visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI);
// CheckFailed - A check failed, so print out the condition and the message
// that failed. This provides a nice place to put a breakpoint if you want
@@ -168,7 +170,6 @@ namespace { // Anonymous namespace for class
};
RegisterPass<Verifier> X("verify", "Module Verifier");
-}
// Assert - We know that cond should be true, if not print an error message.
#define Assert(C, M) \
@@ -368,7 +369,7 @@ void Verifier::visitCallInst(CallInst &CI) {
CI.getOperand(i+1), FTy->getParamType(i));
if (Function *F = CI.getCalledFunction())
- if (LLVMIntrinsic::ID ID = (LLVMIntrinsic::ID)F->getIntrinsicID())
+ if (Intrinsic::ID ID = (Intrinsic::ID)F->getIntrinsicID())
visitIntrinsicFunctionCall(ID, CI);
visitInstruction(CI);
@@ -500,7 +501,7 @@ void Verifier::visitInstruction(Instruction &I) {
}
/// visitIntrinsicFunction - Allow intrinsics to be verified in different ways.
-void Verifier::visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI) {
+void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
Function *IF = CI.getCalledFunction();
const FunctionType *FT = IF->getFunctionType();
Assert1(IF->isExternal(), "Intrinsic functions should never be defined!", IF);
@@ -509,37 +510,37 @@ void Verifier::visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI) {
// FIXME: this should check the return type of each intrinsic as well, also
// arguments!
switch (ID) {
- case LLVMIntrinsic::va_start:
+ case Intrinsic::va_start:
Assert1(CI.getParent()->getParent()->getFunctionType()->isVarArg(),
"llvm.va_start intrinsic may only occur in function with variable"
" args!", &CI);
NumArgs = 0;
break;
- case LLVMIntrinsic::va_end: NumArgs = 1; break;
- case LLVMIntrinsic::va_copy: NumArgs = 1; break;
+ case Intrinsic::va_end: NumArgs = 1; break;
+ case Intrinsic::va_copy: NumArgs = 1; break;
- case LLVMIntrinsic::setjmp: NumArgs = 1; break;
- case LLVMIntrinsic::longjmp: NumArgs = 2; break;
- case LLVMIntrinsic::sigsetjmp: NumArgs = 2; break;
- case LLVMIntrinsic::siglongjmp: NumArgs = 2; break;
+ case Intrinsic::setjmp: NumArgs = 1; break;
+ case Intrinsic::longjmp: NumArgs = 2; break;
+ case Intrinsic::sigsetjmp: NumArgs = 2; break;
+ case Intrinsic::siglongjmp: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_ctlz: NumArgs = 1; break;
- case LLVMIntrinsic::alpha_cttz: NumArgs = 1; break;
- case LLVMIntrinsic::alpha_ctpop: NumArgs = 1; break;
- case LLVMIntrinsic::alpha_umulh: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_vecop: NumArgs = 4; break;
- case LLVMIntrinsic::alpha_pup: NumArgs = 3; break;
- case LLVMIntrinsic::alpha_bytezap: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_bytemanip: NumArgs = 3; break;
- case LLVMIntrinsic::alpha_dfpbop: NumArgs = 3; break;
- case LLVMIntrinsic::alpha_dfpuop: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_unordered: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_uqtodfp: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_uqtosfp: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_dfptosq: NumArgs = 2; break;
- case LLVMIntrinsic::alpha_sfptosq: NumArgs = 2; break;
-
- case LLVMIntrinsic::not_intrinsic:
+ case Intrinsic::alpha_ctlz: NumArgs = 1; break;
+ case Intrinsic::alpha_cttz: NumArgs = 1; break;
+ case Intrinsic::alpha_ctpop: NumArgs = 1; break;
+ case Intrinsic::alpha_umulh: NumArgs = 2; break;
+ case Intrinsic::alpha_vecop: NumArgs = 4; break;
+ case Intrinsic::alpha_pup: NumArgs = 3; break;
+ case Intrinsic::alpha_bytezap: NumArgs = 2; break;
+ case Intrinsic::alpha_bytemanip: NumArgs = 3; break;
+ case Intrinsic::alpha_dfpbop: NumArgs = 3; break;
+ case Intrinsic::alpha_dfpuop: NumArgs = 2; break;
+ case Intrinsic::alpha_unordered: NumArgs = 2; break;
+ case Intrinsic::alpha_uqtodfp: NumArgs = 2; break;
+ case Intrinsic::alpha_uqtosfp: NumArgs = 2; break;
+ case Intrinsic::alpha_dfptosq: NumArgs = 2; break;
+ case Intrinsic::alpha_sfptosq: NumArgs = 2; break;
+
+ case Intrinsic::not_intrinsic:
assert(0 && "Invalid intrinsic!"); NumArgs = 0; break;
}
@@ -548,6 +549,7 @@ void Verifier::visitIntrinsicFunctionCall(LLVMIntrinsic::ID ID, CallInst &CI) {
"Illegal # arguments for intrinsic function!", IF);
}
+} // End anonymous namespace
//===----------------------------------------------------------------------===//
// Implement the public interfaces to this file...
@@ -585,3 +587,5 @@ bool verifyModule(const Module &M) {
PM.run((Module&)M);
return V->Broken;
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/iBranch.cpp b/lib/VMCore/iBranch.cpp
index bcba7145cc..59dc303d70 100644
--- a/lib/VMCore/iBranch.cpp
+++ b/lib/VMCore/iBranch.cpp
@@ -16,6 +16,8 @@
#include "llvm/BasicBlock.h"
#include "llvm/Type.h"
+namespace llvm {
+
BranchInst::BranchInst(BasicBlock *True, BasicBlock *False, Value *Cond,
Instruction *InsertBefore)
: TerminatorInst(Instruction::Br, InsertBefore) {
@@ -49,3 +51,5 @@ BranchInst::BranchInst(const BranchInst &BI) : TerminatorInst(Instruction::Br) {
Operands.push_back(Use(BI.Operands[2], this));
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/iCall.cpp b/lib/VMCore/iCall.cpp
index b99c9e7bb3..c385afc778 100644
--- a/lib/VMCore/iCall.cpp
+++ b/lib/VMCore/iCall.cpp
@@ -17,6 +17,8 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// CallInst Implementation
//===----------------------------------------------------------------------===//
@@ -144,8 +146,12 @@ Function *InvokeInst::getCalledFunction() {
return 0;
}
+} // End llvm namespace
+
#include "llvm/Support/CallSite.h"
+namespace llvm {
+
Function *CallSite::getCalledFunction() const {
Value *Callee = getCalledValue();
if (Function *F = dyn_cast<Function>(Callee))
@@ -155,3 +161,4 @@ Function *CallSite::getCalledFunction() const {
return 0;
}
+} // End llvm namespace
diff --git a/lib/VMCore/iMemory.cpp b/lib/VMCore/iMemory.cpp
index 75309ad8dc..c1a06576cd 100644
--- a/lib/VMCore/iMemory.cpp
+++ b/lib/VMCore/iMemory.cpp
@@ -15,6 +15,8 @@
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
+using namespace llvm;
+
AllocationInst::AllocationInst(const Type *Ty, Value *ArraySize, unsigned iTy,
const std::string &Name, Instruction *InsertBef)
: Instruction(PointerType::get(Ty), iTy, Name, InsertBef) {
diff --git a/lib/VMCore/iOperators.cpp b/lib/VMCore/iOperators.cpp
index d893290198..79fac335fe 100644
--- a/lib/VMCore/iOperators.cpp
+++ b/lib/VMCore/iOperators.cpp
@@ -16,6 +16,8 @@
#include "llvm/Constants.h"
#include "llvm/BasicBlock.h"
+namespace llvm {
+
//===----------------------------------------------------------------------===//
// BinaryOperator Class
//===----------------------------------------------------------------------===//
@@ -194,3 +196,5 @@ Instruction::BinaryOps SetCondInst::getSwappedCondition(BinaryOps Opcode) {
case SetLE: return SetGE;
}
}
+
+} // End llvm namespace
diff --git a/lib/VMCore/iSwitch.cpp b/lib/VMCore/iSwitch.cpp
index e6a4f48ef4..4386b7b837 100644
--- a/lib/VMCore/iSwitch.cpp
+++ b/lib/VMCore/iSwitch.cpp
@@ -14,6 +14,8 @@
#include "llvm/iTerminators.h"
#include "llvm/BasicBlock.h"
+namespace llvm {
+
SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
Instruction *InsertBefore)
: TerminatorInst(Instruction::Switch, InsertBefore) {
@@ -48,3 +50,5 @@ void SwitchInst::removeCase(unsigned idx) {
assert(idx*2 < Operands.size() && "Successor index out of range!!!");
Operands.erase(Operands.begin()+idx*2, Operands.begin()+(idx+1)*2);
}
+
+} // End llvm namespace