diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-18 02:24:56 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-02-18 02:24:56 +0000 |
commit | 3ae6caaf1bddccbc8c8281ec1b67f918df954d87 (patch) | |
tree | cfe8dd54aa61ec93ddfa118eb1240d268eb8d7b7 /clang/lib/CodeGen/TargetInfo.cpp | |
parent | 9543c40df14a51e2091bcf852588c087b72d4afa (diff) | |
download | bcm5719-llvm-3ae6caaf1bddccbc8c8281ec1b67f918df954d87.tar.gz bcm5719-llvm-3ae6caaf1bddccbc8c8281ec1b67f918df954d87.zip |
Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfo
llvm-svn: 125819
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/TargetInfo.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index 881a7ee4d04..f95aab07442 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -355,6 +355,14 @@ bool UseX86_MMXType(const llvm::Type *IRType) { IRType->getScalarSizeInBits() != 64; } +static const llvm::Type* X86AdjustInlineAsmType(CodeGen::CodeGenFunction &CGF, + llvm::StringRef Constraint, + const llvm::Type* Ty) { + if (Constraint=="y" && UseX86_MMXType(Ty)) + return llvm::Type::getX86_MMXTy(CGF.getLLVMContext()); + return Ty; +} + //===----------------------------------------------------------------------===// // X86-32 ABI Implementation //===----------------------------------------------------------------------===// @@ -415,6 +423,13 @@ public: bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, llvm::Value *Address) const; + + const llvm::Type* adjustInlineAsmType(CodeGen::CodeGenFunction &CGF, + llvm::StringRef Constraint, + const llvm::Type* Ty) const { + return X86AdjustInlineAsmType(CGF, Constraint, Ty); + } + }; } @@ -895,6 +910,13 @@ public: return false; } + + const llvm::Type* adjustInlineAsmType(CodeGen::CodeGenFunction &CGF, + llvm::StringRef Constraint, + const llvm::Type* Ty) const { + return X86AdjustInlineAsmType(CGF, Constraint, Ty); + } + }; class WinX86_64TargetCodeGenInfo : public TargetCodeGenInfo { |