[all-commits] [llvm/llvm-project] c7c5b7: [LLVM][Triple] Add an argument to specify canonica...

Shilei Tian via All-commits all-commits at lists.llvm.org
Tue Jan 14 08:55:44 PST 2025


  Branch: refs/heads/users/shiltian/normalize-with-num-fields
  Home:   https://github.com/llvm/llvm-project
  Commit: c7c5b740c813afed4ab2c29ac4d4951d62a04bfc
      https://github.com/llvm/llvm-project/commit/c7c5b740c813afed4ab2c29ac4d4951d62a04bfc
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2025-01-14 (Tue, 14 Jan 2025)

  Changed paths:
    M llvm/include/llvm/TargetParser/Triple.h
    M llvm/lib/TargetParser/Triple.cpp
    M llvm/unittests/TargetParser/TripleTest.cpp

  Log Message:
  -----------
  [LLVM][Triple] Add an argument to specify canonical form to `Triple::normalize`

Currently, the output of `Triple::normalize` can vary depending on how the
`Triple` object is constructed, producing a 3-field, 4-field, or even 5-field
string. However, there is no way to control the format of the output, as all
forms are considered canonical according to the LangRef.

This lack of control can be inconvenient when a specific format is required. To
address this, this PR introduces an argument to specify the desired format (3,
4, or 5 identifiers), with the default set to none to maintain the current
behavior. If the requested format requires more components than are available in
the actual `Data`, `"unknown"` is appended as needed.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list