Fix bogus comparison of "const char *" with c-string literal. Use strcmp instead.
authorTed Kremenek <kremenek@apple.com>
Mon, 27 Oct 2008 22:43:07 +0000 (22:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 27 Oct 2008 22:43:07 +0000 (22:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58290 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

index 6decc00f40ea0f5d4e419fe0dc0b67e93efe057a..9cca6720460d4371adb5b374c810626c30af0e62 100644 (file)
@@ -369,10 +369,10 @@ void SelectionDAG::setSubgraphColor(SDNode *N, const char *Color) {
   bool printed = false;
   if (setSubgraphColorHelper(N, Color, visited, 0, printed)) {
     // Visually mark that we hit the limit
-    if (Color == "red" ) {
+    if (strcmp(Color, "red") == 0) {
       setSubgraphColorHelper(N, "blue", visited, 0, printed);
     }
-    else if (Color == "yellow" ) {
+    else if (strcmp(Color, "yellow") == 0) {
       setSubgraphColorHelper(N, "green", visited, 0, printed);
     }
   }