[llvm-commits] [llvm] r57668 - /llvm/trunk/utils/TableGen/DAGISelEmitter.cpp

Dan Gohman gohman at apple.com
Thu Oct 16 21:40:39 PDT 2008


Author: djg
Date: Thu Oct 16 23:40:39 2008
New Revision: 57668

URL: http://llvm.org/viewvc/llvm-project?rev=57668&view=rev
Log:
Use INT64_C to emit constant values, to avoid problems with
constants that don't fit in an int. This fixes
"this decimal constant is unsigned only in ISO C90"
warnings.

Modified:
    llvm/trunk/utils/TableGen/DAGISelEmitter.cpp

Modified: llvm/trunk/utils/TableGen/DAGISelEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/DAGISelEmitter.cpp?rev=57668&r1=57667&r2=57668&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/DAGISelEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/DAGISelEmitter.cpp Thu Oct 16 23:40:39 2008
@@ -444,7 +444,8 @@
     if (N->isLeaf()) {
       if (IntInit *II = dynamic_cast<IntInit*>(N->getLeafValue())) {
         emitCheck("cast<ConstantSDNode>(" + RootName +
-                  ")->getSExtValue() == " + itostr(II->getValue()));
+                  ")->getSExtValue() == INT64_C(" +
+                  itostr(II->getValue()) + ")");
         return;
       } else if (!NodeIsComplexPattern(N)) {
         assert(0 && "Cannot match this as a leaf value!");
@@ -578,7 +579,7 @@
           const char *MaskPredicate = N->getOperator()->getName() == "or"
             ? "CheckOrMask(" : "CheckAndMask(";
           emitCheck(MaskPredicate + RootName + "0, cast<ConstantSDNode>(" +
-                    RootName + "1), " + itostr(II->getValue()) + ")");
+                    RootName + "1), INT64_C(" + itostr(II->getValue()) + "))");
           
           EmitChildMatchCode(N->getChild(0), N, RootName + utostr(0), RootName,
                              ChainSuffix + utostr(0), FoundChain);





More information about the llvm-commits mailing list