From 53d79d9905bcbf27e8e11cbddeb56c1ed4696339 Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Wed, 22 Aug 2012 21:08:06 +0000 Subject: [PATCH] [ms-inline asm] Add comments. llvm-svn: 162394 --- clang/lib/Sema/SemaStmtAsm.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaStmtAsm.cpp b/clang/lib/Sema/SemaStmtAsm.cpp index f83a5a691279..0827e3d1bc9f 100644 --- a/clang/lib/Sema/SemaStmtAsm.cpp +++ b/clang/lib/Sema/SemaStmtAsm.cpp @@ -328,6 +328,7 @@ static bool isMSAsmKeyword(StringRef Name) { return Ret; } +// getSpelling - Get the spelling of the AsmTok token. static StringRef getSpelling(Sema &SemaRef, Token AsmTok) { StringRef Asm; SmallString<512> TokenBuf; @@ -338,6 +339,7 @@ static StringRef getSpelling(Sema &SemaRef, Token AsmTok) { return Asm; } +// Determine if we should bail on this MSAsm instruction. static bool bailOnMSAsm(std::vector Piece) { for (unsigned i = 0, e = Piece.size(); i != e; ++i) if (isMSAsmKeyword(Piece[i])) @@ -345,6 +347,7 @@ static bool bailOnMSAsm(std::vector Piece) { return false; } +// Determine if we should bail on this MSAsm block. static bool bailOnMSAsm(std::vector > Pieces) { for (unsigned i = 0, e = Pieces.size(); i != e; ++i) if (bailOnMSAsm(Pieces[i])) @@ -352,6 +355,7 @@ static bool bailOnMSAsm(std::vector > Pieces) { return false; } +// Determine if this is a simple MSAsm instruction. static bool isSimpleMSAsm(std::vector &Pieces, const TargetInfo &TI) { if (isMSAsmKeyword(Pieces[0])) @@ -363,6 +367,7 @@ static bool isSimpleMSAsm(std::vector &Pieces, return true; } +// Determine if this is a simple MSAsm block. static bool isSimpleMSAsm(std::vector > Pieces, const TargetInfo &TI) { for (unsigned i = 0, e = Pieces.size(); i != e; ++i) @@ -371,7 +376,7 @@ static bool isSimpleMSAsm(std::vector > Pieces, return true; } -// Break the AsmSting into pieces. +// Break the AsmSting into pieces (i.e., mnemonic and operands). static void buildMSAsmPieces(StringRef Asm, std::vector &Pieces) { std::pair Split = Asm.split(' ');