[LLVMdev] Why no setAddressSpace method?

Dmitry N. Mikushin maemarcus at gmail.com
Sat Jun 9 17:25:42 PDT 2012


Dear LLVM,

A minor thing.

During opt passes it is sometimes needed to adjust the pointer address
space. However, I've noticed PointerType in LLVM has only get accessor, and
clang has its initial setter. Maybe better to

--- DerivedTypes.h    (revision 156703)
+++ DerivedTypes.h    (working copy)
@@ -450,6 +450,9 @@
   /// @brief Return the address space of the Pointer type.
   inline unsigned getAddressSpace() const { return getSubclassData(); }

+  /// @brief Set the address space of the Pointer type.
+  inline void setAddressSpace(unsigned addrspace) {
setSubclassData(addrspace); }
+
   // Implement support type inquiry through isa, cast, and dyn_cast.
   static inline bool classof(const PointerType *) { return true; }
   static inline bool classof(const Type *T) {

- is it wrong or undesired by some reason? This way it would be exposed to
all frontends and opt passes.

Best regards,
- Dima.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120610/365f286d/attachment.html>


More information about the llvm-dev mailing list