]> granicus.if.org Git - clang/commitdiff
Revert r177329.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 19 Mar 2013 14:32:23 +0000 (14:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 19 Mar 2013 14:32:23 +0000 (14:32 +0000)
If this should not happen, we should have an assert.
If it should happen, we should have a test and remove the comment.

In no case should we have this self inconsistent code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177399 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/TargetInfo.cpp

index 193121b2deb15cd214f64af92f8b90a1451c8456..556999f61b3ea100d9e9ca493177d65951e13b08 100644 (file)
@@ -4323,8 +4323,7 @@ public:
                            CodeGen::CodeGenModule &CGM) const {
     const FunctionDecl *FD = dyn_cast<FunctionDecl>(D);
     if (!FD) return;
-    llvm::Function *Fn = dyn_cast<llvm::Function>(GV);
-    if (!Fn) return; // should not happen
+    llvm::Function *Fn = cast<llvm::Function>(GV);
     if (FD->hasAttr<Mips16Attr>()) {
       Fn->addFnAttr("mips16");
     }