================
@@ -43,6 +44,9 @@ class TargetCIRGenInfo {
   /// Returns ABI info helper for the target.
   const ABIInfo &getABIInfo() const { return *info; }
 
+  /// Get the AST address space for alloca.
+  virtual LangAS getASTAllocaAddressSpace() const { return LangAS::Default; }
----------------
RiverDave wrote:

Correct me if I'm wrong, but this might be conflictive given that we're 
essentially trying trying to represent `LangAs::Default` -> Which is implicit. 
Passing a numerical value would dump `target_address_space(0)` on all 
alloca/ptrs which is not the desired behavior. 

Any `addrspace(n)` is taken as target specific in OG as far as I could observe. 

see:
```cpp
enum class LangAS : unsigned {
...
  // This denotes the count of language-specific address spaces and also
  // the offset added to the target-specific address spaces, which are usually
  // specified by address space attributes __attribute__(address_space(n))).
  FirstTargetAddressSpace
  ```
  
  We could in theory, return a nullptr, which makes sense -> no attr(However 
I'm not quite sure. It might look too hacky?)
  
  eg: 
  ```cpp
    /// Get the address space for alloca.
    virtual cir::TargetAddressSpaceAttr getCIRAllocaAddressSpace() const {
      return nullptr;
  }
  ```

https://github.com/llvm/llvm-project/pull/161028
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to