diff options
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 18 | ||||
-rw-r--r-- | lib/VMCore/Constants.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/SlotCalculator.cpp | 8 |
3 files changed, 15 insertions, 14 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 20ac49e4c9..0af79bea56 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -8,7 +8,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Assembly/CachedWriter.h" -#include "llvm/Analysis/SlotCalculator.h" +#include "llvm/SlotCalculator.h" #include "llvm/Module.h" #include "llvm/Function.h" #include "llvm/GlobalVariable.h" @@ -319,7 +319,7 @@ void AssemblyWriter::printModule(const Module *M) { Out << "implementation\n"; - // Output all of the methods... + // Output all of the functions... for_each(M->begin(), M->end(), bind_obj(this,&AssemblyWriter::printFunction)); } @@ -386,14 +386,14 @@ void AssemblyWriter::printConstant(const Constant *CPV) { Out << "\n"; } -// printFunction - Print all aspects of a method. +// printFunction - Print all aspects of a function. // void AssemblyWriter::printFunction(const Function *M) { // Print out the return type and name... Out << "\n" << (M->isExternal() ? "declare " : "") << (M->hasInternalLinkage() ? "internal " : ""); printType(M->getReturnType()) << " \"" << M->getName() << "\"("; - Table.incorporateMethod(M); + Table.incorporateFunction(M); // Loop over the arguments, printing them... const FunctionType *MT = M->getFunctionType(); @@ -425,18 +425,18 @@ void AssemblyWriter::printFunction(const Function *M) { Out << "begin"; - // Output all of its basic blocks... for the method + // Output all of its basic blocks... for the function for_each(M->begin(), M->end(), bind_obj(this, &AssemblyWriter::printBasicBlock)); Out << "end\n"; } - Table.purgeMethod(); + Table.purgeFunction(); } // printFunctionArgument - This member is called for every argument that -// is passed into the method. Simply print it out +// is passed into the function. Simply print it out // void AssemblyWriter::printFunctionArgument(const FunctionArgument *Arg) { // Insert commas as we go... the first arg doesn't get a comma @@ -543,8 +543,8 @@ void AssemblyWriter::printInstruction(const Instruction *I) { const Type *RetTy = MTy ? MTy->getReturnType() : 0; // If possible, print out the short form of the call instruction, but we can - // only do this if the first argument is a pointer to a nonvararg method, - // and if the value returned is not a pointer to a method. + // only do this if the first argument is a pointer to a nonvararg function, + // and if the value returned is not a pointer to a function. // if (RetTy && !MTy->isVarArg() && (!isa<PointerType>(RetTy)||!isa<FunctionType>(cast<PointerType>(RetTy)))){ diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index b73886cf1b..f3f3f49bf6 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -10,7 +10,7 @@ #include "llvm/SymbolTable.h" #include "llvm/GlobalValue.h" #include "llvm/Module.h" -#include "llvm/Analysis/SlotCalculator.h" +#include "llvm/SlotCalculator.h" #include "Support/StringExtras.h" #include <algorithm> @@ -259,6 +259,7 @@ std::string ConstantPointerRef::getStrValue() const { const GlobalValue *V = getValue(); if (V->hasName()) return "%" + V->getName(); + // FIXME: This is a gross hack. SlotCalculator *Table = new SlotCalculator(V->getParent(), true); int Slot = Table->getValSlot(V); delete Table; diff --git a/lib/VMCore/SlotCalculator.cpp b/lib/VMCore/SlotCalculator.cpp index 9c59f12047..4a8312e613 100644 --- a/lib/VMCore/SlotCalculator.cpp +++ b/lib/VMCore/SlotCalculator.cpp @@ -9,7 +9,7 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Analysis/SlotCalculator.h" +#include "llvm/SlotCalculator.h" #include "llvm/Analysis/ConstantsScanner.h" #include "llvm/Function.h" #include "llvm/GlobalVariable.h" @@ -60,7 +60,7 @@ SlotCalculator::SlotCalculator(const Function *M, bool IgnoreNamed) { if (TheModule == 0) return; // Empty table... processModule(); // Process module level stuff - incorporateMethod(M); // Start out in incorporated state + incorporateFunction(M); // Start out in incorporated state } @@ -119,7 +119,7 @@ void SlotCalculator::processSymbolTableConstants(const SymbolTable *ST) { } -void SlotCalculator::incorporateMethod(const Function *M) { +void SlotCalculator::incorporateFunction(const Function *M) { assert(ModuleLevel.size() == 0 && "Module already incorporated!"); SC_DEBUG("begin processFunction!\n"); @@ -182,7 +182,7 @@ void SlotCalculator::incorporateMethod(const Function *M) { SC_DEBUG("end processFunction!\n"); } -void SlotCalculator::purgeMethod() { +void SlotCalculator::purgeFunction() { assert(ModuleLevel.size() != 0 && "Module not incorporated!"); unsigned NumModuleTypes = ModuleLevel.size(); |