diff options
author | dim <dim@FreeBSD.org> | 2015-06-09 19:08:19 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-06-09 19:08:19 +0000 |
commit | bb9760db9b86e93a638ed430d0a14785f7ff9064 (patch) | |
tree | a59f5569ef36d00388c0428426abef26aa9105b6 /lib/AST/MicrosoftMangle.cpp | |
parent | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (diff) | |
download | FreeBSD-src-bb9760db9b86e93a638ed430d0a14785f7ff9064.zip FreeBSD-src-bb9760db9b86e93a638ed430d0a14785f7ff9064.tar.gz |
Vendor import of clang trunk r239412:
https://llvm.org/svn/llvm-project/cfe/trunk@239412
Diffstat (limited to 'lib/AST/MicrosoftMangle.cpp')
-rw-r--r-- | lib/AST/MicrosoftMangle.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index 77522c1..db5b48e 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -2021,23 +2021,29 @@ void MicrosoftCXXNameMangler::mangleType(const VectorType *T, Qualifiers Quals, uint64_t Width = getASTContext().getTypeSize(T); // Pattern match exactly the typedefs in our intrinsic headers. Anything that // doesn't match the Intel types uses a custom mangling below. - bool IntelVector = true; - if (Width == 64 && ET->getKind() == BuiltinType::LongLong) { - Out << "T__m64"; - } else if (Width == 128 || Width == 256) { - if (ET->getKind() == BuiltinType::Float) - Out << "T__m" << Width; - else if (ET->getKind() == BuiltinType::LongLong) - Out << "T__m" << Width << 'i'; - else if (ET->getKind() == BuiltinType::Double) - Out << "U__m" << Width << 'd'; - else - IntelVector = false; + bool IsBuiltin = true; + llvm::Triple::ArchType AT = + getASTContext().getTargetInfo().getTriple().getArch(); + if (AT == llvm::Triple::x86 || AT == llvm::Triple::x86_64) { + if (Width == 64 && ET->getKind() == BuiltinType::LongLong) { + Out << "T__m64"; + } else if (Width >= 128) { + if (ET->getKind() == BuiltinType::Float) + Out << "T__m" << Width; + else if (ET->getKind() == BuiltinType::LongLong) + Out << "T__m" << Width << 'i'; + else if (ET->getKind() == BuiltinType::Double) + Out << "U__m" << Width << 'd'; + else + IsBuiltin = false; + } else { + IsBuiltin = false; + } } else { - IntelVector = false; + IsBuiltin = false; } - if (!IntelVector) { + if (!IsBuiltin) { // The MS ABI doesn't have a special mangling for vector types, so we define // our own mangling to handle uses of __vector_size__ on user-specified // types, and for extensions like __v4sf. |