You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[LLVM][Triple] Drop unknown object types from normalized triples
According to the LangRef the longest canonical form for the triple is:
`ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT`
Seems like object format may also appear at the end of the triple separated by
an additional `-` but it looks like object format is part of the `enviornment`
as opposed to a seperate identifier. This appears to be the case because
various pieces of code that parse the enviornment substring also handle the
object format, and often the code only assumes four componenets where the
enviornment string may also hold the version number and the object format.
Also see: `getEnvironmentName()`.
While creating a Triple, in case of an invalid or unknown object format we
call the `getDefaultFormat()` function which sets the appropriate format. So,
the object format is never really unknown. Since we always set a default
format, having `unknown` as a placeholder can cause issues. This is supported
by the fact that the string expectation for an `UnknownObjectFormat` is `""`,
as seen in `getObjectFormatTypeName()` instead of `"unknown"`. So, to me it
makes sense to drop "unknown" for the triple for object format.
expectation of `getEnvironmentVersionString()` is that if the enviornment
string contains a `"-"` then it has the object format at the end and object
format name and type should match, which is not the case if "-unknown" is
present in the triple.
As a part of this patch I also removed `Triple::CanonicalForm::FIVE_IDENT`.
Change-Id: I5c6ef8fef4ff029ab28f4c3afdab573251cf629c
0 commit comments