aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseStmtAsm.cpp
AgeCommit message (Collapse)Author
2019-02-12Merging r353142:Hans Wennborg
------------------------------------------------------------------------ r353142 | ctopper | 2019-02-05 07:13:14 +0100 (Tue, 05 Feb 2019) | 13 lines [X86] Change MS inline asm clobber list filter to check for 'fpsr' instead of 'fpsw' after D57641. Summary: The backend used to print the x87 FPSW register as 'fpsw', but gcc inline asm uses 'fpsr'. After D57641, the backend now uses 'fpsr' to match. Reviewers: rnk Reviewed By: rnk Subscribers: eraman, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57642 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_80@353819 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30Remove trailing spaceFangrui Song
sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338291 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-27Parse A::template B as an identifier rather than as a template-id with noRichard Smith
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331013 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-26Move MS inline asm parser methods out of line to reduce indentation, NFCReid Kleckner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316674 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-22Create fewer copies of StringMaps. No functionality change intended.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-29[X86][MS-InlineAsm] Extended support for variables / identifiers on memory / ↵Coby Tayree
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-02Update for llvm change.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309885 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30Spelling mistakes in comments. NFCI. (PR27635)Simon Pilgrim
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@299083 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-23Publish RAIIObjectsForParser.h for external usage.Vassil Vassilev
Some clients (eg the cling interpreter) need to recover their parser from errors. Patch by Axel Naumann (D31190)! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298606 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-14MS inline asm: Filter MXCSR out of the inferred clobber listReid Kleckner
Since r295004, LLVM has started modelling this new register, but we don't have GCC constraint inline asm spellings for it yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@295107 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07P0091R3: Implement basic parsing support for C++17 deduction-guides.Richard Smith
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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294266 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05[X86][MS]Adjacent comments within multi-line inline assembly statementCoby Tayree
Allowing adjacent comments within MS inline assembly multi-line statement Differential Revision: https://reviews.llvm.org/D28989 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294120 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_.Richard Smith
In passing, add a warning group for "ignored qualifier in inline assembly" warnings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@288548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-19Fix a funny Dvorak typo.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-18Update for llvm change.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21Correctly parse GCC-style asm line following MS-style asm line.Denis Zobnin
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266976 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07[ms-inline-asm][AVX512] Add ability to use k registers in MS inline asm + ↵Marina Yatsina
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23[ms-inline-asm] Fixing bug in single asm statement supportMarina Yatsina
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09Simplify EnterTokenStream API to make it more robust for memory managementDavid Blaikie
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) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03-inline-asm][X86] Add ability to use AVX512 in MS inline asmMarina Yatsina
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27Update for LLVM change.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15OpaquePtr: Use nullptr construction for ParsedType OpaquePtr typedefDavid Blaikie
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05Remove an unused parameterDavid Majnemer
No functionality change is intended git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256797 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15[Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asmMichael Zuckerman
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255645 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15Revert r247692: Replace Triple with a new TargetTuple in MCTargetDesc/* and ↵Daniel Sanders
related. NFC. Eric has replied and has demanded the patch be reverted. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247702 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15Re-commit r247683: Replace Triple with a new TargetTuple in MCTargetDesc/* ↵Daniel Sanders
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15Revert r247684 - Replace Triple with a new TargetTuple ...Daniel Sanders
LLDB needs to be updated in the same commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-15Replace Triple with a new TargetTuple in MCTargetDesc/* and related. NFC.Daniel Sanders
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26[ms-inline-asm] Add field access to MS inline asm identifier lookupReid Kleckner
Now we can parse code like this: struct A { int field; }; int f(A o) { __asm mov eax, o.field } Fixes PR19117. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246088 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240353 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-16Recommit r239721: Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239812 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15Revert r239721 - Replace string GNU Triples with llvm::Triple in ↵Daniel Sanders
InitMCObjectFileInfo. NFC. It appears to cause sparc-little-endian.s to assert on Windows and Darwin. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-15Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.Daniel Sanders
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@239721 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-12Allow empty assembly string literal with -fno-gnu-inline-asmSteven Wu
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237073 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-31Update for llvm commit r233648.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-16Adding option -fno-inline-asm to disallow inline asmSteven Wu
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226340 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-21Enable ActOnIdExpression to use delayed typo correction for non-C++ codeKaelyn Takata
when calling DiagnoseEmptyLookup. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222551 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-03Initialize MCObjectFileInfo when parsing ms-style asm.Benjamin Kramer
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219023 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-22ms-inline-asm: Scope inline asm labels to functionsEhsan Akhgari
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218230 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27Update for LLVM api change.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216585 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21Update Clang for LLVM API change to use unique_ptr in ↵David Blaikie
SourceManager::AddNewSourceBuffer git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216226 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-25clang-cl: Merge adjacent single-line __asm blocksEhsan Akhgari
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213916 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22Disallowing GNU-style attributes in new expressions, since they are ↵Aaron Ballman
prohibited by GCC as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213650 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17Wrap a comment to 80 columns, no code change.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213288 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15Don't get confused on the number of braces when braces start after the first ↵Ehsan Akhgari
__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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213032 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-06Add support for nested blocks in Microsoft inline assemblyEhsan Akhgari
This fixes http://llvm.org/PR20204. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-23Parse: Simplify construction of the clobber listDavid Majnemer
This avoids going over the clobber list twice. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211485 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-08Split out inline asm parsing into ParseStmtAsm.cppAlp Toker
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210420 91177308-0d34-0410-b5e6-96231b3b80d8