summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ms-inline asm] Comment.Chad Rosier2012-08-161-1/+2
| | | | llvm-svn: 162055
* [ms-inline asm] Extract a helper function, getSpelling(). Also use this onChad Rosier2012-08-161-14/+16
| | | | | | tokens we don't know how to handle; this should aid when debugging. llvm-svn: 162053
* [ms-inline asm] If we don't know how to handle a token then assume this is not aChad Rosier2012-08-161-1/+1
| | | | | | simple asm. llvm-svn: 162051
* [ms-inline asm] Add a helper function, isMSAsmKeyword().Chad Rosier2012-08-161-1/+26
| | | | | | | | These require special handling, which we don't currently handle. This is being put in place to ensure we don't do invalid symbol table lookups or try to parse invalid assembly. The test cases just makes sure the latter isn't happening. llvm-svn: 162050
* Removed unused LParenLoc parameter to ActOnCXXForRangeStmtSam Panzer2012-08-161-6/+4
| | | | llvm-svn: 162048
* [ms-inline asm] Perform symbol table lookup on variables. The idea is to useChad Rosier2012-08-161-8/+30
| | | | | | | this information to determine valid MC operands. This will also be used for semantic analysis. llvm-svn: 162043
* [ms-inline asm] Start tracking which tokens are registers and which areChad Rosier2012-08-161-4/+28
| | | | | | | | variables, function or label references. The former is a potential clobber. The latter is either an input or an output. Unfortunately, it's difficult to test this patch at the moment, but the added test case will eventually do so. llvm-svn: 162026
* [ms-inline asm] Add inputs and outputs to AST. No functional change.Chad Rosier2012-08-161-10/+11
| | | | llvm-svn: 162000
* [ms-inline asm] Use a set container to remove redundant clobbers.Chad Rosier2012-08-151-6/+7
| | | | llvm-svn: 161991
* [ms-inline asm] Address a FIXME by computing the number of asm statements whenChad Rosier2012-08-151-10/+7
| | | | | | building the AsmString. llvm-svn: 161988
* [ms-inline asm] MSVC parses multiple __asm statements on a single line as oneChad Rosier2012-08-151-8/+29
| | | | | | | | | | | | statement. For example, if (x) __asm out dx, ax __asm out dx, ax results in a single inline asm statement (i.e., both "out dx, ax" statements are predicated on if(x)). llvm-svn: 161986
* [ms-inline asm] Don't emit newlines as these are ignored by the AsmParserChad Rosier2012-08-151-4/+1
| | | | | | anyways. Also, simplify some conditional logic. llvm-svn: 161977
* [ms-inline asm] Capturing loop-scoped (std::string)Reg with a StringRef is bad.Chad Rosier2012-08-151-3/+5
| | | | llvm-svn: 161966
* [ms-inline asm] Add the left brace source location and improve the prettyChad Rosier2012-08-151-7/+9
| | | | | | printer. Patch by Enea Zaffanella <zaffanella@cs.unipr.it>. llvm-svn: 161958
* clang/lib/Sema/SemaStmt.cpp: Include MCAsmLexer.h to appease msvc to define ↵NAKAMURA Takumi2012-08-151-0/+1
| | | | | | llvm::AsmToken. llvm-svn: 161927
* [ms-inline asm] Have MC start parsing the asms.Chad Rosier2012-08-151-1/+52
| | | | llvm-svn: 161913
* [ms-inline asm] Remove the last bits of LineEnds.Chad Rosier2012-08-141-6/+5
| | | | llvm-svn: 161904
* [ms-inline asm] Simplify more logic by using the Token::hasLeadingSpace() andChad Rosier2012-08-141-47/+10
| | | | | | Token::isAtStartOfLine() APIs. llvm-svn: 161898
* [ms-inline asm] Address a potential buffer overflow.Chad Rosier2012-08-141-5/+2
| | | | llvm-svn: 161896
* [ms-inline asm] Simplify the logic in patchMSAsmString. We no longer need toChad Rosier2012-08-141-46/+55
| | | | | | track the LineEnds now that single line asm statments aren't merged. llvm-svn: 161893
* [ms-inline asm] Add a helpful assert.Chad Rosier2012-08-131-0/+1
| | | | llvm-svn: 161796
* [ms-inline asm] Address a potential buffer overflow.Chad Rosier2012-08-131-5/+1
| | | | llvm-svn: 161793
* [ms-inline asm] Have patchMSAsmStrings() return a vector or AsmStrings.Chad Rosier2012-08-131-62/+79
| | | | | | | | | | | | | | | | | | | | | | | | | The AsmParser expects a single asm instruction, but valid ms-style inline asm statements may contain multiple instructions. This happens with asm blocks __asm { mov ebx, eax mov ecx, ebx } or when multiple asm statements are adjacent to one another __asm mov ebx, eax __asm mov ecx, ebx and __asm mov ebx, eax __asm mov ecx, ebx Currently, asm blocks are not properly handled. llvm-svn: 161780
* [ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asmChad Rosier2012-08-101-0/+9
| | | | | | | statements. Therefore, we can't pass the PatchedAsmString to the AsmParser and expect things to work. llvm-svn: 161701
* [ms-inline asm] Fix a memory leak introduced in r161686.Chad Rosier2012-08-101-1/+1
| | | | llvm-svn: 161698
* [ms-inline asm] Add clobbers to AST representation.Chad Rosier2012-08-101-2/+3
| | | | llvm-svn: 161686
* [ms-inline asm] Use asserts as these calls are now guarded by identical checks.Chad Rosier2012-08-101-9/+5
| | | | llvm-svn: 161676
* Whitespace.Chad Rosier2012-08-101-31/+31
| | | | llvm-svn: 161673
* [ms-inline asm] Fix comment.Chad Rosier2012-08-091-1/+1
| | | | llvm-svn: 161622
* [ms-inline asm] Use StringRef here, per Jordan's suggestion.Chad Rosier2012-08-091-1/+1
| | | | llvm-svn: 161619
* [ms-inline asm] Simplify logic for empty asm statements.Chad Rosier2012-08-091-0/+10
| | | | llvm-svn: 161615
* [ms-inline asm] Instantiate the various parts to the AsmParser.Chad Rosier2012-08-091-4/+40
| | | | llvm-svn: 161614
* [ms-inline asm] Initialize targets and assembly printers/parsers.Chad Rosier2012-08-091-0/+6
| | | | llvm-svn: 161595
* [ms-inline asm] Use more idiomatic logic. Thanks, Bill.Chad Rosier2012-08-081-2/+2
| | | | llvm-svn: 161526
* [ms-inline asm] Make sure IsSimple is correctly handled.Chad Rosier2012-08-081-3/+3
| | | | llvm-svn: 161522
* Remove extraneous comment.Chad Rosier2012-08-081-1/+0
| | | | llvm-svn: 161521
* [ms-inline asm] Add a very simple test case. Basically, we're only testing forChad Rosier2012-08-081-0/+6
| | | | | | crashers at the moment (and coincidentally this case was causing a crash). llvm-svn: 161520
* [ms-inline asm] Refactor the logic to generate the AsmString into Sema. NoChad Rosier2012-08-081-5/+31
| | | | | | functional change intended. llvm-svn: 161518
* [ms-inline asm] Add support for detecting simple ms-style inline asm. SimpleChad Rosier2012-08-081-2/+104
| | | | | | | | | | | asm statements are those that don't reference variable names, function names, and labels. Add logic to generate a patched AsmString that will eventually be consumed by the AsmParser. No functional change at this point, so unfortunately no test case. llvm-svn: 161508
* Add the IsSimple/IsVolatile parameters to the MSAsmStmt constructor.Chad Rosier2012-08-081-1/+2
| | | | llvm-svn: 161503
* [ms-inline asm] Stmt destructors are never called, so allocate the AsmToks usingChad Rosier2012-08-071-1/+1
| | | | | | the ASTContext BumpPtr. Also use the preferred llvm::ArrayRef interface. llvm-svn: 161373
* [ms-inline asm] Pass Tokens to Sema and store them in the AST. No functionalChad Rosier2012-08-061-1/+2
| | | | | | change intended. No test case as there's no real way to test at this time. llvm-svn: 161342
* Consolidate ObjC lookupPrivateMethod methods from Sema and DeclObjC.Anna Zaks2012-07-271-1/+1
| | | | | | | | | | | | | Also, fix a subtle bug, which occurred due to lookupPrivateMethod defined in DeclObjC.h not looking up the method inside parent's categories. Note, the code assumes that Class's parent object has the same methods as what's in the Root class of a the hierarchy, which is a heuristic that might not hold for hierarchies which do not descend from NSObject. Would be great to fix this in the future. llvm-svn: 160885
* Issue warning when assigning out-of-range integer values to enums.Fariborz Jahanian2012-07-171-0/+49
| | | | | | | Due to performance cost, this is an opt-in option placed under -Wassign-enum. // rdar://11824807 llvm-svn: 160382
* Don't try to do RVO on block variables that refer to an enclosing local.Nico Weber2012-07-111-1/+1
| | | | | | | Fixes PR13314, clang crashing on blocks refering to an enclosing local when the enclosing function returns void. llvm-svn: 160089
* Inline storage of attributes in AttributedStmt.Alexander Kornienko2012-07-091-5/+3
| | | | llvm-svn: 159925
* objective-c++11: extend c++11 range-based loop to iterateFariborz Jahanian2012-07-061-0/+12
| | | | | | over objective-c container collection. // rdar://9293227 llvm-svn: 159847
* objective-c: Refactor parse/sema portion ofFariborz Jahanian2012-07-031-9/+29
| | | | | | | objective-c's fast enumeration statement, for more work to come. llvm-svn: 159689
* In blocks, only pretend that enum constants have enum type if necessary.Jordan Rose2012-07-021-44/+21
| | | | | | | | | | | | | | | | | | In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) Thus, when a block's return type is inferred from an enum constant, it is incompatible with expressions that return the enum type. In r158899, I told block returns to pretend that enum constants have enum type, like in C++. Doug Gregor pointed out that this can break existing code. Now, we don't check the types of return statements until the end of the block. This lets us go back and add implicit casts in blocks with mixed enum constants and enum-typed expressions. <rdar://problem/11662489> (again) llvm-svn: 159591
* Pretend that enum constants have enum type when inferring a block return type.Jordan Rose2012-06-211-3/+25
| | | | | | | | | | | | In C, enum constants have the type of the enum's underlying integer type, rather than the type of the enum. (This is not true in C++.) This leads to odd warnings when returning enum constants directly in blocks with inferred return types. The easiest way out of this is to pretend that, like C++, enum constants have enum type when being returned from a block. <rdar://problem/11662489> llvm-svn: 158899
OpenPOWER on IntegriCloud