HomePhabricator

Normalize default value for -triple correctly

Authored by dang on Jul 10 2020, 5:57 AM.

Description

Normalize default value for -triple correctly

Details

Committed
dangJul 10 2020, 5:58 AM
Parents
rGd4ce862f2aa8: Reland "[FPEnv][Clang][Driver] Disable constrained floating point on targets…
Branches
Unknown
Tags
Unknown

Event Timeline

MaskRay added inline comments.
/clang/include/clang/Driver/Options.td
3460

Is Normalizer<"normalizeTriple"> still needed?

Do you have a description about the behavior difference?

dang marked an inline comment as done.Jul 11 2020, 2:00 AM
dang added inline comments.
/clang/include/clang/Driver/Options.td
3460

Normalizer<"normalizeTriple"> is used to normalize user-specified triples passed in with the -triple CC1 option, while llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple()) is the default value for when the user doesn't specify -triple. We can't use llvm::sys::getDefaultTargetTriple() directly because the return value of llvm::sys::getDefaultTargetTriple() is not correctly normalized on some platforms (powerpc is one of that we know of because of a test failure).