summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-03-13 20:40:30 +0000
committerReed Kotler <rkotler@mips.com>2013-03-13 20:40:30 +0000
commit3d5966f31bb47011798b720098dcfbacb33214b9 (patch)
tree3d33ff95237896e99c22caa6e074b0543bf69701 /clang/lib/CodeGen/TargetInfo.cpp
parent74fc23fa5de3ce8dc1501adbcfbca2db12a62b52 (diff)
downloadbcm5719-llvm-3d5966f31bb47011798b720098dcfbacb33214b9.tar.gz
bcm5719-llvm-3d5966f31bb47011798b720098dcfbacb33214b9.zip
Cause the mips16/nomips16 attribute to be passed to LLVM from Clang
in the LLVM assembly language output. llvm-svn: 176971
Diffstat (limited to 'clang/lib/CodeGen/TargetInfo.cpp')
-rw-r--r--clang/lib/CodeGen/TargetInfo.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp
index 81267ca7671..556999f61b3 100644
--- a/clang/lib/CodeGen/TargetInfo.cpp
+++ b/clang/lib/CodeGen/TargetInfo.cpp
@@ -4321,11 +4321,17 @@ public:
void SetTargetAttributes(const Decl *D, llvm::GlobalValue *GV,
CodeGen::CodeGenModule &CGM) const {
- //
- // can fill this in when new attribute work in llvm is done.
- // attributes mips16 and nomips16 need to be handled here.
- //
+ const FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
+ if (!FD) return;
+ llvm::Function *Fn = cast<llvm::Function>(GV);
+ if (FD->hasAttr<Mips16Attr>()) {
+ Fn->addFnAttr("mips16");
+ }
+ else if (FD->hasAttr<NoMips16Attr>()) {
+ Fn->addFnAttr("nomips16");
+ }
}
+
bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
llvm::Value *Address) const;
OpenPOWER on IntegriCloud