From: Chris Lattner Date: Thu, 12 Aug 2004 19:06:24 +0000 (+0000) Subject: Add information on adding a derived type to LLVM, patch contributed by X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=8dad40c337cbdcc5d777a543407dc246651cb396;p=oota-llvm.git Add information on adding a derived type to LLVM, patch contributed by Brad Jones! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15703 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/ExtendingLLVM.html b/docs/ExtendingLLVM.html index 810b5a70648..775a431db0c 100644 --- a/docs/ExtendingLLVM.html +++ b/docs/ExtendingLLVM.html @@ -215,7 +215,47 @@ installations. Only add new types if it is absolutely necessary.

-

TODO

+
    +
  1. llvm/include/llvm/Type.def: + add enum for the type
  2. + +
  3. llvm/include/llvm/Type.h: + add ID number for the new type; add a forward declaration of the type also
  4. + +
  5. llvm/include/llvm/DerivedType.h: + add new class to represent new class in the hierarchy; add forward + declaration to the TypeMap value type
  6. + +
  7. llvm/lib/VMCore/Type.cpp: + add support for derived type to: + std::string getTypeDescription(const Type &Ty, + std::vector &TypeStack) + bool TypesEqual(const Type* Ty, const Type *Ty2, + std::map & EqTypes) + add necessary member functions for type, and factory + methods
  8. + +
  9. llvm/lib/AsmReader/Lexer.l: + add ability to parse in the type from text assembly
  10. + +
  11. llvm/lib/ByteCode/Writer/Writer.cpp: + modify void BytecodeWriter::outputType(const Type *T) to + serialize your type
  12. + +
  13. llvm/lib/ByteCode/Reader/Reader.cpp: + modify const Type *BytecodeReader::ParseType() to + read your data type
  14. + +
  15. llvm/lib/VMCore/AsmWriter.cpp: + modify void calcTypeName(const Type *Ty, + std::vector &TypeStack, + std::map &TypeNames, + std::string & Result) + to output the new derived type +
  16. + + +