aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaStmtAsm.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-08-22 21:08:06 +0000
committerChad Rosier <mcrosier@apple.com>2012-08-22 21:08:06 +0000
commit358ab765f36f70d0744ede7dc35ce74c0911e77d (patch)
treec87d4eac76a48e3da0cf3c0bd643ebbf26d904fc /lib/Sema/SemaStmtAsm.cpp
parentf0fbd776df77bc4b8b3e6ff3542b2e9117b2b905 (diff)
[ms-inline asm] Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmtAsm.cpp')
-rw-r--r--lib/Sema/SemaStmtAsm.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index f83a5a6912..0827e3d1bc 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/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<StringRef> Piece) {
for (unsigned i = 0, e = Piece.size(); i != e; ++i)
if (isMSAsmKeyword(Piece[i]))
@@ -345,6 +347,7 @@ static bool bailOnMSAsm(std::vector<StringRef> Piece) {
return false;
}
+// Determine if we should bail on this MSAsm block.
static bool bailOnMSAsm(std::vector<std::vector<StringRef> > Pieces) {
for (unsigned i = 0, e = Pieces.size(); i != e; ++i)
if (bailOnMSAsm(Pieces[i]))
@@ -352,6 +355,7 @@ static bool bailOnMSAsm(std::vector<std::vector<StringRef> > Pieces) {
return false;
}
+// Determine if this is a simple MSAsm instruction.
static bool isSimpleMSAsm(std::vector<StringRef> &Pieces,
const TargetInfo &TI) {
if (isMSAsmKeyword(Pieces[0]))
@@ -363,6 +367,7 @@ static bool isSimpleMSAsm(std::vector<StringRef> &Pieces,
return true;
}
+// Determine if this is a simple MSAsm block.
static bool isSimpleMSAsm(std::vector<std::vector<StringRef> > Pieces,
const TargetInfo &TI) {
for (unsigned i = 0, e = Pieces.size(); i != e; ++i)
@@ -371,7 +376,7 @@ static bool isSimpleMSAsm(std::vector<std::vector<StringRef> > 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<StringRef> &Pieces) {
std::pair<StringRef,StringRef> Split = Asm.split(' ');