Creates a new [Builder] from a [TargetIsa], copying all flags in the process.
(target_isa: &dyn TargetIsa)
| 193 | /// Creates a new [Builder] from a [TargetIsa], copying all flags in the |
| 194 | /// process. |
| 195 | pub fn from_target_isa(target_isa: &dyn TargetIsa) -> Builder { |
| 196 | // We should always be able to find the builder for the TargetISA, since presumably we |
| 197 | // also generated the previous TargetISA at some point |
| 198 | let triple = target_isa.triple().clone(); |
| 199 | let mut builder = self::lookup(triple).expect("Could not find triple for target ISA"); |
| 200 | |
| 201 | // Copy ISA Flags |
| 202 | for flag in target_isa.isa_flags() { |
| 203 | builder.set(&flag.name, &flag.value_string()).unwrap(); |
| 204 | } |
| 205 | |
| 206 | builder |
| 207 | } |
| 208 | |
| 209 | /// Gets the triple for the builder. |
| 210 | pub fn triple(&self) -> &Triple { |