[llvm-commits] [hlvm] r38363 - /hlvm/trunk/hlvm/AST/AST.cpp

Reid Spencer reid at x10sys.com
Sat Jul 7 17:02:40 PDT 2007


Author: reid
Date: Sat Jul  7 19:02:40 2007
New Revision: 38363

URL: http://llvm.org/viewvc/llvm-project?rev=38363&view=rev
Log:
When checking the referent of a ReferenceOp, check AutoVarop first, Argument
second, and Constant last because that is the likely order of frequency.

Modified:
    hlvm/trunk/hlvm/AST/AST.cpp

Modified: hlvm/trunk/hlvm/AST/AST.cpp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/hlvm/AST/AST.cpp?rev=38363&r1=38362&r2=38363&view=diff

==============================================================================
--- hlvm/trunk/hlvm/AST/AST.cpp (original)
+++ hlvm/trunk/hlvm/AST/AST.cpp Sat Jul  7 19:02:40 2007
@@ -823,12 +823,12 @@
   hlvmAssert(V != 0 && "ReferenceOp must have a Value to reference");
   ReferenceOp* result = new ReferenceOp();
   const Type* refType = V->getType();
-  if (llvm::isa<Constant>(V) || llvm::isa<Argument>(V) ||
-      llvm::isa<AutoVarOp>(V)) {
+  if (llvm::isa<AutoVarOp>(V) || 
+      llvm::isa<Argument>(V) ||
+      llvm::isa<Constant>(V))
     result->setType(refType);
-  } else {
+  else
     hlvmAssert(!"Invalid referent type");
-  }
   result->setLocator(loc);
   result->setReferent(V);
   return result;





More information about the llvm-commits mailing list