r177399 - Revert r177329.

Rafael Espindola rafael.espindola at gmail.com
Tue Mar 19 07:32:23 PDT 2013


Author: rafael
Date: Tue Mar 19 09:32:23 2013
New Revision: 177399

URL: http://llvm.org/viewvc/llvm-project?rev=177399&view=rev
Log:
Revert r177329.

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.

Modified:
    cfe/trunk/lib/CodeGen/TargetInfo.cpp

Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=177399&r1=177398&r2=177399&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Tue Mar 19 09:32:23 2013
@@ -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");
     }





More information about the cfe-commits mailing list