summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseStmtAsm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-1/+1
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* Parse A::template B as an identifier rather than as a template-id with noRichard Smith2018-04-271-1/+1
| | | | | | | | | | template arguments. This fixes some cases where we'd incorrectly accept "A::template B" when B is a kind of template that requires template arguments (in particular, a variable template or a concept). llvm-svn: 331013
* Move MS inline asm parser methods out of line to reduce indentation, NFCReid Kleckner2017-10-261-98/+118
| | | | llvm-svn: 316674
* Create fewer copies of StringMaps. No functionality change intended.Benjamin Kramer2017-10-221-1/+1
| | | | llvm-svn: 316301
* [X86][MS-InlineAsm] Extended support for variables / identifiers on memory / ↵Coby Tayree2017-09-291-16/+10
| | | | | | | | | | | immediate expressions Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized. supersedes D33278, D35774 Differential Revision: https://reviews.llvm.org/D37413 llvm-svn: 314494
* Update for llvm change.Rafael Espindola2017-08-021-2/+1
| | | | llvm-svn: 309885
* Spelling mistakes in comments. NFCI. (PR27635)Simon Pilgrim2017-03-301-1/+1
| | | | llvm-svn: 299083
* Publish RAIIObjectsForParser.h for external usage.Vassil Vassilev2017-03-231-1/+1
| | | | | | | | | Some clients (eg the cling interpreter) need to recover their parser from errors. Patch by Axel Naumann (D31190)! llvm-svn: 298606
* MS inline asm: Filter MXCSR out of the inferred clobber listReid Kleckner2017-02-141-4/+5
| | | | | | | Since r295004, LLVM has started modelling this new register, but we don't have GCC constraint inline asm spellings for it yet. llvm-svn: 295107
* P0091R3: Implement basic parsing support for C++17 deduction-guides.Richard Smith2017-02-071-0/+1
| | | | | | | | | | | We model deduction-guides as functions with a new kind of name that identifies the template whose deduction they guide; the bulk of this patch is adding the new name kind. This gives us a clean way to attach an extensible list of guides to a class template in a way that doesn't require any special handling in AST files etc (and we're going to need these functions we come to performing deduction). llvm-svn: 294266
* [X86][MS]Adjacent comments within multi-line inline assembly statementCoby Tayree2017-02-051-0/+5
| | | | | | | | Allowing adjacent comments within MS inline assembly multi-line statement Differential Revision: https://reviews.llvm.org/D28989 llvm-svn: 294120
* More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_.Richard Smith2016-12-021-3/+3
| | | | | | In passing, add a warning group for "ignored qualifier in inline assembly" warnings. llvm-svn: 288548
* Fix a funny Dvorak typo.Rafael Espindola2016-05-191-1/+1
| | | | llvm-svn: 270006
* Update for llvm change.Rafael Espindola2016-05-181-2/+2
| | | | llvm-svn: 269910
* Correctly parse GCC-style asm line following MS-style asm line.Denis Zobnin2016-04-211-4/+38
| | | | | | | | | | | | | | Quit parsing MS-style inline assembly if the following statement has GCC style. Enables compilation of code like void f() { __asm mov ebx, ecx __asm__("movl %ecx, %edx"); } Differential Revision: http://reviews.llvm.org/D18652 llvm-svn: 266976
* [ms-inline-asm][AVX512] Add ability to use k registers in MS inline asm + ↵Marina Yatsina2016-03-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | fix bag with curly braces Until now curly braces could only be used in MS inline assembly to mark block start/end. All curly braces were removed completely at a very early stage. This approach caused bugs like: "m{o}v eax, ebx" turned into "mov eax, ebx" without any error. In addition, AVX-512 added special operands (e.g., k registers), which are also surrounded by curly braces that mark them as such. Now, we need to keep the curly braces and identify at a later stage if they are marking block start/end (if so, ignore them), or surrounding special AVX-512 operands (if so, parse them as such). This patch fixes the bug described above and enables the use of AVX-512 special operands. This commit is the the clang part of the patch. The clang part of the review is: http://reviews.llvm.org/D17766 The llvm part of the review is: http://reviews.llvm.org/D17767 Differential Revision: http://reviews.llvm.org/D17766 llvm-svn: 262842
* [ms-inline-asm] Fixing bug in single asm statement supportMarina Yatsina2016-02-231-0/+4
| | | | | | | | | | | | | | Fixing a crash caused by trying to merge a single-line asm statement with an asm block that follows it, e.g: asm int 4 asm { int 5 } Now, only adjacent single-line asm statements that are not surrounded by braces will be merged into one asm call. Differential Revision: http://reviews.llvm.org/D17496 llvm-svn: 261618
* Simplify EnterTokenStream API to make it more robust for memory managementDavid Blaikie2016-02-091-3/+1
| | | | | | | | | | | | | | | While this won't help fix things like the bug that r260219 addressed, it seems like good tidy up to have anyway. (it might be nice if "makeArrayRef" always produced a MutableArrayRef & let it decay to an ArrayRef when needed - then I'd use that for the MutableArrayRefs in this patch) If we had std::dynarray I'd use that instead of unique_ptr+size_t, ideally (but then it'd have to be threaded down through the Preprocessor all the way - no idea how painful that would be) llvm-svn: 260246
* -inline-asm][X86] Add ability to use AVX512 in MS inline asmMarina Yatsina2016-02-031-1/+6
| | | | | | | | | Defined the new AVX512 registers in clang inline asm. Fixed a bug in the MC subtarget info creation during the parsing of MS asm statement - now it receives the actual CPU and target features information. Differential Revision: http://reviews.llvm.org/D16757 llvm-svn: 259639
* Update for LLVM change.Benjamin Kramer2016-01-271-1/+1
| | | | llvm-svn: 258918
* OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedefDavid Blaikie2016-01-151-7/+6
| | | | llvm-svn: 257958
* Remove an unused parameterDavid Majnemer2016-01-051-3/+2
| | | | | | No functionality change is intended llvm-svn: 256797
* [Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asmMichael Zuckerman2015-12-151-11/+16
| | | | | | | | | | | | | | | | | | | | | Clang doesn’t support a use of “this” pointer inside inline asm. When I tried to compile a class or a struct (see example) with an inline asm that contains "this" pointer. Clang returns with an error. This patch fixes that. error: expected unqualified-id For example: ''' struct A { void f() { __asm mov eax, this // error: expected unqualified-id } }; ''' Differential Revision: http://reviews.llvm.org/D15115 llvm-svn: 255645
* Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and ↵Daniel Sanders2015-09-151-2/+2
| | | | | | | | related. NFC. Eric has replied and has demanded the patch be reverted. llvm-svn: 247702
* Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* ↵Daniel Sanders2015-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | and related. NFC. Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Thanks go to Pavel Labath for fixing LLDB for me. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247692
* Revert r247684 - Replace Triple with a new TargetTuple ...Daniel Sanders2015-09-151-2/+2
| | | | | | LLDB needs to be updated in the same commit. llvm-svn: 247686
* Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.Daniel Sanders2015-09-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the first patch in the series to migrate Triple's (which are ambiguous) to TargetTuple's (which aren't). For the moment, TargetTuple simply passes all requests to the Triple object it holds. Once it has replaced Triple, it will start to implement the interface in a more suitable way. This change makes some changes to the public C++ API. In particular, InitMCSubtargetInfo(), createMCRelocationInfo(), and createMCSymbolizer() now take TargetTuples instead of Triples. The other public C++ API's have been left as-is for the moment to reduce patch size. This commit also contains a trivial patch to clang to account for the C++ API change. Reviewers: rengolin Subscribers: jyknight, dschuff, arsenm, rampitec, danalbert, srhines, javed.absar, dsanders, echristo, emaste, jholewinski, tberghammer, ted, jfb, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10969 llvm-svn: 247683
* [ms-inline-asm] Add field access to MS inline asm identifier lookupReid Kleckner2015-08-261-3/+20
| | | | | | | | | | | | | | Now we can parse code like this: struct A { int field; }; int f(A o) { __asm mov eax, o.field } Fixes PR19117. llvm-svn: 246088
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-1/+1
| | | | llvm-svn: 240353
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-1/+1
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Recommit r239721: Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | InitMCObjectFileInfo. NFC. Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. The first time this was committed it accidentally fixed an inconsistency in triples in llvm-mc and this caused a failure. This inconsistency was fixed in r239808. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239812
* Revert r239721 - Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders2015-06-151-2/+2
| | | | | | | | InitMCObjectFileInfo. NFC. It appears to cause sparc-little-endian.s to assert on Windows and Darwin. llvm-svn: 239724
* Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.Daniel Sanders2015-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar trivial patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239721
* Allow empty assembly string literal with -fno-gnu-inline-asmSteven Wu2015-05-121-4/+9
| | | | | | | | | Empty assembly string will not introduce assembly code in the output binary and it is often used as a trick in the header to disable optimizations. It doesn't conflict with the purpose of the option so it is allowed with -fno-gnu-inline-asm flag. llvm-svn: 237073
* Update for llvm commit r233648.Eric Christopher2015-03-311-1/+1
| | | | llvm-svn: 233649
* Adding option -fno-inline-asm to disallow inline asmSteven Wu2015-01-161-0/+5
| | | | | | | | | | | | | | | | Summary: This patch add a new option to dis-allow all inline asm. Any GCC style inline asm will be reported as an error. Reviewers: rnk, echristo Reviewed By: rnk, echristo Subscribers: bob.wilson, rnk, echristo, rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D6870 llvm-svn: 226340
* Enable ActOnIdExpression to use delayed typo correction for non-C++ codeKaelyn Takata2014-11-211-1/+1
| | | | | | when calling DiagnoseEmptyLookup. llvm-svn: 222551
* Initialize MCObjectFileInfo when parsing ms-style asm.Benjamin Kramer2014-10-031-0/+2
| | | | | | | Otherwise we're left with an half-initialized bag of variables that may or may not explode later on. Should bring the MSVC buildbot back to life. llvm-svn: 219023
* ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari2014-09-221-4/+18
| | | | | | | | | | | | | | | | Summary: This fixes PR20023. In order to implement this scoping rule, we piggy back on the existing LabelDecl machinery, by creating LabelDecl's that will carry the "internal" name of the inline assembly label, which we will rewrite the asm label to. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4589 llvm-svn: 218230
* Update for LLVM api change.Rafael Espindola2014-08-271-2/+2
| | | | llvm-svn: 216585
* Update Clang for LLVM API change to use unique_ptr in ↵David Blaikie2014-08-211-3/+3
| | | | | | SourceManager::AddNewSourceBuffer llvm-svn: 216226
* clang-cl: Merge adjacent single-line __asm blocksEhsan Akhgari2014-07-251-9/+20
| | | | | | | | | | | | | | | | | Summary: This patch extends the __asm parser to make it keep parsing input tokens as inline assembly if a single-line __asm line is followed by another line starting with __asm too. It also makes sure that we correctly keep matching braces in such situations by separating the notions of how many braces we are matching and whether we are in single-line asm block mode. Reviewers: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4598 llvm-svn: 213916
* Disallowing GNU-style attributes in new expressions, since they are ↵Aaron Ballman2014-07-221-1/+1
| | | | | | prohibited by GCC as well. llvm-svn: 213650
* Wrap a comment to 80 columns, no code change.Nico Weber2014-07-171-1/+2
| | | | llvm-svn: 213288
* Don't get confused on the number of braces when braces start after the first ↵Ehsan Akhgari2014-07-151-2/+1
| | | | | | | | | | | | | | | | __asm Summary: Without this, we would not consume the closing brace which would cause the parser to start consuming C++ and bad things would happen. Reviewers: majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4505 llvm-svn: 213032
* Add support for nested blocks in Microsoft inline assemblyEhsan Akhgari2014-07-061-17/+49
| | | | | | This fixes http://llvm.org/PR20204. llvm-svn: 212389
* Parse: Simplify construction of the clobber listDavid Majnemer2014-06-231-4/+1
| | | | | | | | This avoids going over the clobber list twice. No functionality change. llvm-svn: 211485
* Split out inline asm parsing into ParseStmtAsm.cppAlp Toker2014-06-081-0/+732
This change isolates various llvm/MC headers from the rest of the parser and better aligns with the existing SemaStmtAsm.cpp. No change in functionality, code move only. llvm-svn: 210420
OpenPOWER on IntegriCloud