//===-- Module.cpp - Implement the Module class ---------------------------===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file implements the Module class for the VMCore library.
// Methods to implement the globals and functions lists.
//
-Function *ilist_traits<Function>::createSentinal() {
+Function *ilist_traits<Function>::createSentinel() {
FunctionType *FTy =
FunctionType::get(Type::VoidTy, std::vector<const Type*>(), false);
Function *Ret = new Function(FTy, GlobalValue::ExternalLinkage);
LeakDetector::removeGarbageObject(Ret);
return Ret;
}
-GlobalVariable *ilist_traits<GlobalVariable>::createSentinal() {
+GlobalVariable *ilist_traits<GlobalVariable>::createSentinel() {
GlobalVariable *Ret = new GlobalVariable(Type::IntTy, false,
GlobalValue::ExternalLinkage);
// This should not be garbage monitored.
if (Function *F = getFunction("main", FunctionType::get(Type::IntTy,
Params, false)))
return F;
-
+
// void main(int argc, char **argv)...
if (Function *F = getFunction("main", FunctionType::get(Type::VoidTy,
Params, false)))
/// have the top-level PointerType, which represents the address of the
/// global.
///
-GlobalVariable *Module::getGlobalVariable(const std::string &Name,
+GlobalVariable *Module::getGlobalVariable(const std::string &Name,
const Type *Ty) {
if (Value *V = getSymbolTable().lookup(PointerType::get(Ty), Name)) {
GlobalVariable *Result = cast<GlobalVariable>(V);
SymbolTable &ST = getSymbolTable();
if (ST.lookupType(Name)) return true; // Already in symtab...
-
+
// Not in symbol table? Set the name with the Symtab as an argument so the
// type knows what to update...
ST.insert(Name, Ty);
for(Module::iterator I = begin(), E = end(); I != E; ++I)
I->dropAllReferences();
- for(Module::giterator I = gbegin(), E = gend(); I != E; ++I)
+ for(Module::global_iterator I = global_begin(), E = global_end(); I != E; ++I)
I->dropAllReferences();
}