#include "llvm/GlobalValue.h"
#include "llvm/BasicBlock.h"
#include "llvm/Argument.h"
-#include "Support/Annotation.h"
+#include "llvm/Support/Annotation.h"
namespace llvm {
const Type *getReturnType() const; // Return the type of the ret val
const FunctionType *getFunctionType() const; // Return the FunctionType for me
+ /// isVarArg - Return true if this function takes a variable number of
+ /// arguments.
+ bool isVarArg() const;
+
/// isExternal - Is the body of this function unknown? (The basic block list
/// is empty if so.) This is true for external functions, defined as forward
/// "declare"ations
unsigned getIntrinsicID() const;
bool isIntrinsic() const { return getIntrinsicID() != 0; }
+ /// renameLocalSymbols - This method goes through the Function's symbol table
+ /// and renames any symbols that conflict with symbols at global scope. This
+ /// is required before printing out to a textual form, to ensure that there is
+ /// no ambiguity when parsing.
+ void renameLocalSymbols();
+
+
/// deleteBody - This method deletes the body of the function, and converts
/// the linkage to external.
///
setLinkage(ExternalLinkage);
}
+ /// removeFromParent - This method unlinks 'this' from the containing module,
+ /// but does not delete it.
+ ///
+ void removeFromParent();
+
+ /// eraseFromParent - This method unlinks 'this' from the containing module
+ /// and deletes it.
+ ///
+ void eraseFromParent();
+
+
// getNext/Prev - Return the next or previous function in the list. These
// methods should never be used directly, and are only used to implement the
// function list as part of the module.
reverse_iterator rend () { return BasicBlocks.rend(); }
const_reverse_iterator rend () const { return BasicBlocks.rend(); }
- unsigned size() const { return BasicBlocks.size(); }
+ size_t size() const { return BasicBlocks.size(); }
bool empty() const { return BasicBlocks.empty(); }
const BasicBlock &front() const { return BasicBlocks.front(); }
BasicBlock &front() { return BasicBlocks.front(); }
- const BasicBlock &back() const { return BasicBlocks.back(); }
- BasicBlock &back() { return BasicBlocks.back(); }
+ const BasicBlock &back() const { return BasicBlocks.back(); }
+ BasicBlock &back() { return BasicBlocks.back(); }
//===--------------------------------------------------------------------===//
// Argument iterator forwarding functions
reverse_aiterator arend () { return ArgumentList.rend(); }
const_reverse_aiterator arend () const { return ArgumentList.rend(); }
- unsigned asize() const { return ArgumentList.size(); }
+ size_t asize() const { return ArgumentList.size(); }
bool aempty() const { return ArgumentList.empty(); }
const Argument &afront() const { return ArgumentList.front(); }
Argument &afront() { return ArgumentList.front(); }
- const Argument &aback() const { return ArgumentList.back(); }
- Argument &aback() { return ArgumentList.back(); }
+ const Argument &aback() const { return ArgumentList.back(); }
+ Argument &aback() { return ArgumentList.back(); }
virtual void print(std::ostream &OS) const { print(OS, 0); }
void print(std::ostream &OS, AssemblyAnnotationWriter *AAW) const;