09d7710e04 
								
							 
						 
						
							
							
								
								[ms-inline asm] Rewrite the symbol references as wildcard MCParsedAsmOperands.  
							
							... 
							
							
							
							A Sema lookup is used to determine the size of the variable, which is in turn
used during wildcard matching.
llvm-svn: 165058 
							
						 
						
							2012-10-02 21:49:14 +00:00  
				
					
						
							
							
								 
						
							
								04d5664295 
								
							 
						 
						
							
							
								
								[ms-inline asm] Enhance the isSimpleMSAsm() function to handle operands with pointer size  
							
							... 
							
							
							
							directives (e.g., dword ptr [eax]).
llvm-svn: 165031 
							
						 
						
							2012-10-02 18:51:05 +00:00  
				
					
						
							
							
								 
						
							
								0ede0986b9 
								
							 
						 
						
							
							
								
								No need to call the InitializeAll* functions.  
							
							... 
							
							
							
							llvm-svn: 165025 
							
						 
						
							2012-10-02 16:41:12 +00:00  
				
					
						
							
							
								 
						
							
								bb90c414c4 
								
							 
						 
						
							
							
								
								[ms-inline asm] Use the convertToMapAndConstraints() function in the front-end.  
							
							... 
							
							
							
							Rework the logic to account for the fact that we no longer create a MCInst.
llvm-svn: 164980 
							
						 
						
							2012-10-01 23:45:59 +00:00  
				
					
						
							
							
								 
						
							
								24719e3236 
								
							 
						 
						
							
							
								
								Examine the last, not the first, instruction from the MC matcher.  
							
							... 
							
							
							
							If an MS-style inline asm is matched to multiple instructions, e.g., with a
a WAIT-prefix, then we need to examine the operands of the last instruction
instruction, not the prefix instruction.
llvm-svn: 164608 
							
						 
						
							2012-09-25 16:30:16 +00:00  
				
					
						
							
							
								 
						
							
								93b3eb7793 
								
							 
						 
						
							
							
								
								Update for r164567.  
							
							... 
							
							
							
							llvm-svn: 164568 
							
						 
						
							2012-09-24 22:58:50 +00:00  
				
					
						
							
							
								 
						
							
								317be45091 
								
							 
						 
						
							
							
								
								Replace an assertion with an error for empty __asm statements.  
							
							... 
							
							
							
							llvm-svn: 164551 
							
						 
						
							2012-09-24 19:57:59 +00:00  
				
					
						
							
							
								 
						
							
								0fc64f0b11 
								
							 
						 
						
							
							
								
								Fix a comment typo and clean up formatting.  
							
							... 
							
							
							
							llvm-svn: 164550 
							
						 
						
							2012-09-24 19:57:55 +00:00  
				
					
						
							
							
								 
						
							
								90cad09ba5 
								
							 
						 
						
							
							
								
								[ms-inline asm] Use mnemonicIsValid() in a helpful assert.  
							
							... 
							
							
							
							llvm-svn: 164421 
							
						 
						
							2012-09-21 22:22:39 +00:00  
				
					
						
							
							
								 
						
							
								f83315fd4a 
								
							 
						 
						
							
							
								
								Add a few FIXMEs.  
							
							... 
							
							
							
							llvm-svn: 163758 
							
						 
						
							2012-09-13 00:20:37 +00:00  
				
					
						
							
							
								 
						
							
								b261a50b40 
								
							 
						 
						
							
							
								
								[ms-inline asm]  Handle the enumeration of input and output expressions in a  
							
							... 
							
							
							
							more robust way to address a few FIXMEs.
The initial implementation, r163342, built the IR asm string and then tried to
patch things on the fly without enough context.  Specifically, it didn't skip
mnemonics nor did it track with assembly instruction an expression was related
to.  The new implementation patches the operands and then builds the final
IR string.
llvm-svn: 163756 
							
						 
						
							2012-09-13 00:06:55 +00:00  
				
					
						
							
							
								 
						
							
								57cd91f683 
								
							 
						 
						
							
							
								
								[ms-inline asm] If we have a single asm operand that maps to multiple  
							
							... 
							
							
							
							MCOperands then iterate over all of then when computing clobbers, inputs and
outputs.
On x86 the 1-to-many mapping is a memory operand that includes a BaseReg(reg),
MemScale(imm), MemIndexReg(reg), an Expr(MCExpr or imm) and a MemSegReg(reg).
Invalid register (Op.getReg() == 0) are not considered when computing clobber.
llvm-svn: 163728 
							
						 
						
							2012-09-12 18:14:25 +00:00  
				
					
						
							
							
								 
						
							
								a4f52e16a5 
								
							 
						 
						
							
							
								
								[ms-inline asm] isDef/NumDefs in this context only refer to register definitions, not memory definitions.  
							
							... 
							
							
							
							llvm-svn: 163666 
							
						 
						
							2012-09-11 23:53:48 +00:00  
				
					
						
							
							
								 
						
							
								911d50fe4e 
								
							 
						 
						
							
							
								
								[ms-inline asm] As of r163657 this check is unnecessary.  
							
							... 
							
							
							
							llvm-svn: 163665 
							
						 
						
							2012-09-11 23:48:00 +00:00  
				
					
						
							
							
								 
						
							
								ee94a2ebd5 
								
							 
						 
						
							
							
								
								[ms-inline asm] Don't consider tokens or immediates when computing clobbers, inputs and outputs.  
							
							... 
							
							
							
							llvm-svn: 163657 
							
						 
						
							2012-09-11 23:13:15 +00:00  
				
					
						
							
							
								 
						
							
								bd7fdadb90 
								
							 
						 
						
							
							
								
								[ms-inline asm] Add $$ before numeric constants in the IR.  
							
							... 
							
							
							
							llvm-svn: 163581 
							
						 
						
							2012-09-11 00:51:28 +00:00  
				
					
						
							
							
								 
						
							
								46b0a0adbe 
								
							 
						 
						
							
							
								
								[ms-inline asm] Output empty asm statements for the directives we don't  
							
							... 
							
							
							
							handle.  Otherwise, the AsmParser will explode if we try to generate an
object files.
llvm-svn: 163345 
							
						 
						
							2012-09-06 19:56:25 +00:00  
				
					
						
							
							
								 
						
							
								c05d2c908d 
								
							 
						 
						
							
							
								
								[ms-inline asm] The IR representation of inline assembly enumerates the input  
							
							... 
							
							
							
							and output expressions much like that in GNU-style inline assembly. Output
expressions are first.  Do this for MS-style inline asms.
llvm-svn: 163342 
							
						 
						
							2012-09-06 19:35:00 +00:00  
				
					
						
							
							
								 
						
							
								87b3d03cc2 
								
							 
						 
						
							
							
								
								Update for r163187.  
							
							... 
							
							
							
							llvm-svn: 163188 
							
						 
						
							2012-09-05 01:16:06 +00:00  
				
					
						
							
							
								 
						
							
								dea7964ddb 
								
							 
						 
						
							
							
								
								[ms-inline asm] The MCInstrDesc only tracks register definitions.  For now,  
							
							... 
							
							
							
							assume that if the 1st operands is an expression and the instruction mayStore,
then it is a memory definition.
llvm-svn: 163144 
							
						 
						
							2012-09-04 16:39:38 +00:00  
				
					
						
							
							
								 
						
							
								5c8822d3ff 
								
							 
						 
						
							
							
								
								Fix 80-column violation.  
							
							... 
							
							
							
							llvm-svn: 163142 
							
						 
						
							2012-09-04 15:58:44 +00:00  
				
					
						
							
							
								 
						
							
								93380f63c9 
								
							 
						 
						
							
							
								
								[ms-inline asm] Use the new GetMCInstOperandNum() interface in the front-end.  
							
							... 
							
							
							
							llvm-svn: 163126 
							
						 
						
							2012-09-03 20:40:52 +00:00  
				
					
						
							
							
								 
						
							
								fd648a0320 
								
							 
						 
						
							
							
								
								Removed unused argument.  
							
							... 
							
							
							
							llvm-svn: 163105 
							
						 
						
							2012-09-03 03:16:15 +00:00  
				
					
						
							
							
								 
						
							
								30c0cb2f30 
								
							 
						 
						
							
							
								
								[ms-inline asm] Update for the MatchInstruction API change in r163101.  
							
							... 
							
							
							
							llvm-svn: 163102 
							
						 
						
							2012-09-03 02:30:13 +00:00  
				
					
						
							
							
								 
						
							
								6f0a9a2e2f 
								
							 
						 
						
							
							
								
								Revert r162424 now that the scoping issue has been fixed in r162444.  
							
							... 
							
							
							
							llvm-svn: 162797 
							
						 
						
							2012-08-28 22:08:58 +00:00  
				
					
						
							
							
								 
						
							
								7ae6360758 
								
							 
						 
						
							
							
								
								Tidy up.  
							
							... 
							
							
							
							llvm-svn: 162786 
							
						 
						
							2012-08-28 20:35:06 +00:00  
				
					
						
							
							
								 
						
							
								3dd7bf2c86 
								
							 
						 
						
							
							
								
								[ms-inline asm] Add constraints to MSAsmStmt.  We don't currently compute  
							
							... 
							
							
							
							the constraints, so in the interim we speculatively assume a 'r' constraint.
This is expected to work for most cases on x86.
llvm-svn: 162784 
							
						 
						
							2012-08-28 20:28:20 +00:00  
				
					
						
							
							
								 
						
							
								de70e0ef45 
								
							 
						 
						
							
							
								
								[ms-inline asm] As part of a larger refactoring, rename AsmStmt to GCCAsmStmt.  
							
							... 
							
							
							
							No functional change intended.
llvm-svn: 162632 
							
						 
						
							2012-08-25 00:11:56 +00:00  
				
					
						
							
							
								 
						
							
								175ea24e38 
								
							 
						 
						
							
							
								
								[ms-inline asm] Change the -fenable-experimental-ms-inline-asm option from a  
							
							... 
							
							
							
							CodeGen option to a LangOpt option.  In turn, hoist the guard into the parser 
so that we avoid the new (and fairly unstable) Sema/AST/CodeGen logic.  This
should restore the behavior of clang to that prior to r158325.
<rdar://problem/12163681>
llvm-svn: 162602 
							
						 
						
							2012-08-24 21:42:51 +00:00  
				
					
						
							
							
								 
						
							
								c5d00f61b6 
								
							 
						 
						
							
							
								
								Remove unnecessary calls to c_str.  
							
							... 
							
							
							
							llvm-svn: 162590 
							
						 
						
							2012-08-24 20:43:21 +00:00  
				
					
						
							
							
								 
						
							
								1e17cf9c22 
								
							 
						 
						
							
							
								
								[ms-inline asm] Generate the Input/Output expressions using  
							
							... 
							
							
							
							Sema::ActOnIdExpression().
llvm-svn: 162564 
							
						 
						
							2012-08-24 16:38:58 +00:00  
				
					
						
							
							
								 
						
							
								ab24b6e24e 
								
							 
						 
						
							
							
								
								Fix 80-column violation.  
							
							... 
							
							
							
							llvm-svn: 162560 
							
						 
						
							2012-08-24 15:51:10 +00:00  
				
					
						
							
							
								 
						
							
								fe31e626ca 
								
							 
						 
						
							
							
								
								[ms-inline asm] Add the basic APIs for Exprs to the MSAsmStmt AST.  Next we need  
							
							... 
							
							
							
							generate the Input/Output expressions using Sema::ActOnIdExpression().
llvm-svn: 162509 
							
						 
						
							2012-08-24 00:07:09 +00:00  
				
					
						
							
							
								 
						
							
								cc4c49dd63 
								
							 
						 
						
							
							
								
								Now that ASTMultiPtr is nothing more than a array reference, make it a MutableArrayRef.  
							
							... 
							
							
							
							This required changing all get() calls to data() and using the simpler constructors.
llvm-svn: 162501 
							
						 
						
							2012-08-23 23:38:35 +00:00  
				
					
						
							
							
								 
						
							
								8e0744312b 
								
							 
						 
						
							
							
								
								[ms-inline asm] Rename a few induction variables to avoid confusion and silence  
							
							... 
							
							
							
							a gcc warning.
llvm-svn: 162444 
							
						 
						
							2012-08-23 15:44:35 +00:00  
				
					
						
							
							
								 
						
							
								1e774bc835 
								
							 
						 
						
							
							
								
								Don't recycle loop variables (to keep GCC happy).  
							
							... 
							
							
							
							llvm-svn: 162424 
							
						 
						
							2012-08-23 01:51:18 +00:00  
				
					
						
							
							
								 
						
							
								0cf0615571 
								
							 
						 
						
							
							
								
								Fix 80-column violation.  
							
							... 
							
							
							
							llvm-svn: 162416 
							
						 
						
							2012-08-23 00:12:51 +00:00  
				
					
						
							
							
								 
						
							
								f4958d1f10 
								
							 
						 
						
							
							
								
								[ms-inline asm] Compute the inputs and outputs.  No test case (yet) as this  
							
							... 
							
							
							
							requires codegen support.
llvm-svn: 162410 
							
						 
						
							2012-08-22 23:42:09 +00:00  
				
					
						
							
							
								 
						
							
								dc5311aab6 
								
							 
						 
						
							
							
								
								[ms-inline asm] Refactor code so that we can begin computing the Inputs/Outputs.  
							
							... 
							
							
							
							No functional change intended.
llvm-svn: 162403 
							
						 
						
							2012-08-22 22:10:51 +00:00  
				
					
						
							
							
								 
						
							
								eb7deb2851 
								
							 
						 
						
							
							
								
								[ms-inline asm] Add comments.  
							
							... 
							
							
							
							llvm-svn: 162396 
							
						 
						
							2012-08-22 21:12:19 +00:00  
				
					
						
							
							
								 
						
							
								53d79d9905 
								
							 
						 
						
							
							
								
								[ms-inline asm] Add comments.  
							
							... 
							
							
							
							llvm-svn: 162394 
							
						 
						
							2012-08-22 21:08:06 +00:00  
				
					
						
							
							
								 
						
							
								bb365caf80 
								
							 
						 
						
							
							
								
								[ms-inline asm] Add helper function.  No functional change intended.  
							
							... 
							
							
							
							llvm-svn: 162393 
							
						 
						
							2012-08-22 21:04:07 +00:00  
				
					
						
							
							
								 
						
							
								6b6a8a363b 
								
							 
						 
						
							
							
								
								[ms-inline asm] Simplify logic.  No functional change intended.  
							
							... 
							
							
							
							llvm-svn: 162392 
							
						 
						
							2012-08-22 20:57:07 +00:00  
				
					
						
							
							
								 
						
							
								060c0ea89a 
								
							 
						 
						
							
							
								
								[ms-inline asm] Compute the token range for each instruction within the asm.  
							
							... 
							
							
							
							Eventually, we'll need a way of mapping tokens (and their IdentifierInfo*) to
the operands computed by buildMSAsmPieces().
llvm-svn: 162388 
							
						 
						
							2012-08-22 20:30:58 +00:00  
				
					
						
							
							
								 
						
							
								a766697f4e 
								
							 
						 
						
							
							
								
								[ms-inline asm] Simplify logic.  No functional change intended.  
							
							... 
							
							
							
							llvm-svn: 162385 
							
						 
						
							2012-08-22 19:50:28 +00:00  
				
					
						
							
							
								 
						
							
								d997bd1422 
								
							 
						 
						
							
							
								
								[ms-inline asm] Start sending non-simple inline asms to the AsmParser.  
							
							... 
							
							
							
							The parser still can't handle all cases, so fall back to emitting a simple
MSAsmStmt if we get into trouble.
llvm-svn: 162382 
							
						 
						
							2012-08-22 19:18:30 +00:00  
				
					
						
							
							
								 
						
							
								bbdd467895 
								
							 
						 
						
							
							
								
								[ms-inline asm] Remove the patchMSAsmStrings function.  After some discussion  
							
							... 
							
							
							
							between Bob, Jim, Eric and I, we've decided to take a slightly different
approach.
llvm-svn: 162327 
							
						 
						
							2012-08-21 23:09:21 +00:00  
				
					
						
							
							
								 
						
							
								b958037958 
								
							 
						 
						
							
							
								
								[ms-inline asm] Have buildMSAsmString build a vector of unmodified AsmStrings.  
							
							... 
							
							
							
							Add a new static function, buildMSAsmPieces, that will break these strings down
into mnemonic and operands.  Upon a match failure, the idea is to use the
ErrorInfo from MatchInstructionImpl to inspect the mnemonic/operand and 
decide a course of action.  Unfortunately, there's no easy way to test this at
the moment.
llvm-svn: 162321 
							
						 
						
							2012-08-21 21:56:39 +00:00  
				
					
						
							
							
								 
						
							
								5111f8650d 
								
							 
						 
						
							
							
								
								[ms-inline asm] Do not report a Parser error when matching inline assembly.  
							
							... 
							
							
							
							llvm-svn: 162307 
							
						 
						
							2012-08-21 19:37:55 +00:00  
				
					
						
							
							
								 
						
							
								19160b6e39 
								
							 
						 
						
							
							
								
								[ms-inline asm] Expose the ErrorInfo from the MatchInstructionImpl.  In general,  
							
							... 
							
							
							
							this is the index of the operand that failed to match.
llvm-svn: 162296 
							
						 
						
							2012-08-21 18:15:08 +00:00  
				
					
						
							
							
								 
						
							
								5e80ced3f6 
								
							 
						 
						
							
							
								
								[ms-inline asm] Append identifier for better debugging.  
							
							... 
							
							
							
							llvm-svn: 162289 
							
						 
						
							2012-08-21 17:02:27 +00:00  
				
					
						
							
							
								 
						
							
								b84cc6cfa3 
								
							 
						 
						
							
							
								
								[ms-inline asm] Remove this test case and the associated special case code.  
							
							... 
							
							
							
							llvm-svn: 162288 
							
						 
						
							2012-08-21 17:01:26 +00:00  
				
					
						
							
							
								 
						
							
								d4e55b8e35 
								
							 
						 
						
							
							
								
								[ms-inline asm] Remove old cruft now that MS-style asms their own code path.  
							
							... 
							
							
							
							llvm-svn: 162210 
							
						 
						
							2012-08-20 17:11:53 +00:00  
				
					
						
							
							
								 
						
							
								571c5e91c4 
								
							 
						 
						
							
							
								
								[ms-inline asm] Update comment.  
							
							... 
							
							
							
							llvm-svn: 162134 
							
						 
						
							2012-08-17 21:27:25 +00:00  
				
					
						
							
							
								 
						
							
								0731affaca 
								
							 
						 
						
							
							
								
								[ms-inline asm] Extract AsmStmt handling into a separate file, so as to not  
							
							... 
							
							
							
							pollute SemaStmt with extraneous asm handling logic.
llvm-svn: 162132 
							
						 
						
							2012-08-17 21:19:40 +00:00