[clang] [llvm] [clang][OMPIRBuilder] Use default target AS to create types (PR #158152)

Nick Sarnie via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 12 07:56:28 PDT 2025


================
@@ -125,16 +125,19 @@ class OpenMPIRBuilderConfig {
 
   /// First separator used between the initial two parts of a name.
   std::optional<StringRef> FirstSeparator;
-  /// Separator used between all of the rest consecutive parts of s name
+  /// Separator used between all of the rest consecutive parts of s name.
   std::optional<StringRef> Separator;
 
-  // Grid Value for the GPU target
+  // Grid Value for the GPU target.
   std::optional<omp::GV> GridValue;
 
   /// When compilation is being done for the OpenMP host (i.e. `IsTargetDevice =
   /// false`), this contains the list of offloading triples associated, if any.
   SmallVector<Triple> TargetTriples;
 
+  // Default address space for the target.
+  unsigned DefaultTargetAS = 0;
----------------
sarnex wrote:

I didn't use `std::optional` here because we create `OpenMPIRBuilder` directly in a ton of unit tests directly and I didn't want to update them all, and also I think that since we already assume the default `AS` is zero we can continue doing that in cases where we don't set it from `clang`.

https://github.com/llvm/llvm-project/pull/158152


More information about the llvm-commits mailing list