[PATCH] MS inline asm: Allow __asm blocks to set a return value

David Majnemer david.majnemer at gmail.com
Wed Sep 3 15:54:39 PDT 2014


================
Comment at: lib/CodeGen/TargetInfo.cpp:644
@@ +643,3 @@
+      // We have an operand reference.
+      size_t DigitStart = Pos;
+      size_t DigitEnd = AsmString.find_first_not_of("0123456789", DigitStart);
----------------
Pos == DigitStart, they point to the first non dollar character.

================
Comment at: lib/CodeGen/TargetInfo.cpp:645
@@ +644,3 @@
+      size_t DigitStart = Pos;
+      size_t DigitEnd = AsmString.find_first_not_of("0123456789", DigitStart);
+      if (DigitEnd == std::string::npos)
----------------
If the character at DigitStart is not a number, DigitStart == DigitEnd.

================
Comment at: lib/CodeGen/TargetInfo.cpp:657
@@ +656,3 @@
+      }
+      Pos = DigitEnd;
+    }
----------------
If DigitStart == DigitEnd, wouldn't Pos be unchanged at this point? I guess that would be handled by the next iteration of the loop.

http://reviews.llvm.org/D5177






More information about the cfe-commits mailing list