summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Documentation parsing. Some refactoring and codeFariborz Jahanian2013-03-081-2/+2
| | | | | | improvements per Dmtiri's comments. // rdar://12379114 llvm-svn: 176739
* HeaderDoc: Support more of HeaderDoc documentation Fariborz Jahanian2013-03-071-0/+2
| | | | | | | | commands; top level tags such as @interface and their 2nd level tags such as @coclass, etc. // rdar://12379114 llvm-svn: 176667
* doc parsing. We want to issue a strong warning whenFariborz Jahanian2013-03-051-0/+1
| | | | | | | an @function comment is not followed by a function decl. // rdar://13094352 llvm-svn: 176468
* Strip 'llvm' from 'llvm::Optional' uses.Ted Kremenek2013-02-211-1/+1
| | | | llvm-svn: 175701
* Comment parsing: improve the fidelity of XML output for many block commandsDmitri Gribenko2013-02-013-0/+53
| | | | | | | | | | | | | | This change introduces a 'kind' attribute for the <Para> tag, that captures the kind of the parent block command. For example: \todo Meow. used to be just <Para>Meow.</Para>, but now it is <Para kind="todo">Meow.</Para> llvm-svn: 174216
* [Sema][Attr]Fix alignment attribute printing.Michael Han2013-02-011-0/+47
| | | | | | | | | Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should only model those appear in source code. Introduce attribute Accessor, and teach TableGen to generate syntax kind accessors for Align attribute, and use those accessors to decide if an alignment attribute is a declspec attribute. llvm-svn: 174133
* [Comment parsing] Add support for recognizingFariborz Jahanian2013-01-311-0/+1
| | | | | | | | \headerfile command and representing it in an xml document. Patch reviewed by Dmitri Gribenko. // rdar://12397511 llvm-svn: 174109
* Add indents to AST dumping and removed parenthesis from AST nodes.Richard Trieu2013-01-311-4/+37
| | | | | | | | | | | | | | | | | | | | | Indents were given the color blue when outputting with color. AST dumping now looks like this: Node |-Node | `-Node `-Node `-Node Compared to the previous: (Node (Node (Node)) (Node (Node))) llvm-svn: 174022
* TableGen backends: use emitSourceFileHeader() to emit the warning aboutDmitri Gribenko2013-01-305-18/+34
| | | | | | file contents being autogenerated llvm-svn: 173979
* Comment parsing: resolve more named character referencesDmitri Gribenko2013-01-304-0/+93
| | | | | | | | | This reimplements r173850 with a better approach: (1) use a TableGen-generated matcher instead of doing a linear search; (2) avoid allocations for new strings by converting code points to string iterals with TableGen. llvm-svn: 173931
* Propagate the spelling list index for an attribute across template ↵Richard Smith2013-01-291-1/+1
| | | | | | instantiation. llvm-svn: 173768
* Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelledRichard Smith2013-01-291-1/+5
| | | | | | | | | as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
* Add the missing line return to align parameters of printPretty.Michael Han2013-01-271-1/+1
| | | | llvm-svn: 173597
* PR14922: when printing an attribute, use the real syntax of the attribute ↵Michael Han2013-01-243-21/+148
| | | | | | | | | | | | | (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax. Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td. This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute. When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and name, then passed to Attr that will use the index to print itself. Thanks to Richard Smith for the idea and review. llvm-svn: 173358
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-3/+3
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Error if an anonymous DiagGroup is referenced multiple times.Jordan Rose2013-01-101-2/+119
| | | | | | | | | | | Not only is this inefficient for TableGen, it's annoying for maintenance when renaming warning flags (unusual) or adding those flags to a group (more likely). This uses the new fix-it infrastructure for LLVM's SourceMgr/SMDiagnostic, as well as a few changes to TableGen to track more source information. llvm-svn: 172087
* Fixed a number of -Wcovered-switch-default diagnostics in ↵Alexander Kornienko2013-01-071-5/+0
| | | | | | tools/clang/include/clang/AST/AttrDump.inc llvm-svn: 171768
* Implement Attr dumping for -ast-dump.Alexander Kornienko2013-01-073-13/+129
| | | | | | | | http://llvm-reviews.chandlerc.com/D234 Patch by Philip Craig! llvm-svn: 171760
* Sort the #include lines under utils/...Chandler Carruth2012-12-043-7/+5
| | | | llvm-svn: 169245
* [PCH] Reading expressions from attributes should be done using ReadExpr(),Argyrios Kyrtzidis2012-11-151-1/+1
| | | | | | | | | | | not ReadExpr(). Also add a test case making sure the thread safety attributes work as expected when they come from a PCH. Fixes rdar://12584141 & http://llvm.org/PR13982 llvm-svn: 168017
* Don't require exception handling for clang-tblgen.Joerg Sonnenberger2012-10-252-2/+0
| | | | llvm-svn: 166713
* Don't throw exceptions in clang-tblgen by switching to PrintFatalError.Joerg Sonnenberger2012-10-254-18/+24
| | | | | | Add locations in a number of places, where they are available for free. llvm-svn: 166691
* [Options] Add prefixes to options.Michael J. Spencer2012-10-221-2/+79
| | | | | | | | | | | | | | Each option has a set of prefixes. When matching an argument such as -funroll-loops. First the leading - is removed as it is a prefix. Then a lower_bound search for "funroll-loops" is done against the option table by option name. From there each option prefix + option name combination is tested against the argument. This allows us to support Microsoft style options where both / and - are valid prefixes. It also simplifies the cases we already have where options come in both - and -- forms. Almost every option for gnu-ld happens to have this form. llvm-svn: 166444
* Remove pointless classof()'s.Sean Silva2012-10-111-2/+0
| | | | | | | Updates to llvm/Support/Casting.h have rendered these classof()'s irrelevant. llvm-svn: 165770
* tblgen: Build clang-tblgen without RTTI.Sean Silva2012-10-102-2/+0
| | | | | | clang-tblgen no longer needs RTTI! llvm-svn: 165650
* tblgen: Use LLVM-style RTTI in clang-tblgenSean Silva2012-10-104-25/+24
| | | | llvm-svn: 165649
* tblgen: Migrate clang-tblgen to new TableGenMain API.Sean Silva2012-10-031-87/+82
| | | | llvm-svn: 165167
* Comment sema: warn when comment has \deprecated but declaration does not have aDmitri Gribenko2012-09-221-0/+1
| | | | | | | | | deprecation attribute ('deprecated', 'availability' or 'unavailable'). This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it can be turned off easily while leaving other -Wdocumentation warnings on. llvm-svn: 164467
* Comment parsing: handle \deprecated command. It is a block command, but itDmitri Gribenko2012-09-131-0/+1
| | | | | | | should be fine to use it without further explanations in the attached paragraph, so the warning about empty paragraph was turned off for it. llvm-svn: 163836
* Comment AST: TableGen'ize all command lists in CommentCommandTraits.cpp.Dmitri Gribenko2012-09-104-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we have a list of all commands. This is a good thing in itself, but it also enables us to easily implement typo correction for command names. With this change we have objects that contain information about each command, so it makes sense to resolve command name just once during lexing (currently we store command names as strings and do a linear search every time some property value is needed). Thus comment token and AST nodes were changed to contain a command ID -- index into a tables of builtin and registered commands. Unknown commands are registered during parsing and thus are also uniformly assigned an ID. Using an ID instead of a StringRef is also a nice memory optimization since ID is a small integer that fits into a common bitfield in Comment class. This change implies that to get any information about a command (even a command name) we need a CommandTraits object to resolve the command ID to CommandInfo*. Currently a fresh temporary CommandTraits object is created whenever it is needed since it does not have any state. But with this change it has state -- new commands can be registered, so a CommandTraits object was added to ASTContext. Also, in libclang CXComment has to be expanded to include a CXTranslationUnit so that all functions working on comment AST nodes can get a CommandTraits object. This breaks binary compatibility of CXComment APIs. Now clang_FullComment_getAsXML(CXTranslationUnit TU, CXComment CXC) doesn't need TU parameter anymore, so it was removed. This is a source-incompatible change for this C API. llvm-svn: 163540
* Dont cast away const needlessly. Found by gcc48 -Wcast-qual.Roman Divacky2012-09-061-2/+2
| | | | llvm-svn: 163325
* Comment HTML tag name machers: move from StringSwitch to an efficientDmitri Gribenko2012-08-314-0/+89
| | | | | | TableGen-generated string matcher. llvm-svn: 162969
* Don't constant-fold when pretty-printing alignment attribute. This fixes aRichard Smith2012-08-161-3/+6
| | | | | | potential crasher -- Context is sometimes a null reference (!!) here. llvm-svn: 162007
* Placate the mingw32 buildbot by suffixing 64-bit constants with ULL.Richard Smith2012-08-141-2/+2
| | | | llvm-svn: 161831
* Fix undefined behavior (and wrong code, as far as I can tell) in NEON builtinRichard Smith2012-08-141-3/+3
| | | | | | | | | tablegen code, found by -fcatch-undefined-behavior. I would appreciate if someone more familiar with the NEON code could point me in the direction of how to write a test for this. We appear to have essentially no test coverage whatsoever for these builtins. llvm-svn: 161827
* Fix horrible regression in control of warnings caused by introduction of ↵Ted Kremenek2012-08-101-4/+12
| | | | | | | | | | | | | | | -Wpedantic. While -Wpedantic was reasonable, -Wno-pedantic would turn off a bunch of warnings that are on by default. This counters the intention of this warning flag. To fix this, -Wpedantic now includes extentions that are not on by default. The remaining warnings will manifest anyway, and won't accidentally get turned off by -Wno-pedantic. Fixes <rdar://problem/12076105> llvm-svn: 161695
* Add missing cctype includes.Joerg Sonnenberger2012-08-101-0/+1
| | | | llvm-svn: 161660
* Enhance ClangDiagnosticsEmitter to reject diagnostics that are errors that ↵Ted Kremenek2012-08-071-0/+17
| | | | | | | | | | | | | | are also included in warning groups. Warning groups can only contain warnings, because only warnings can be mapped to errors or ignored. This caught a few diagnostics that were incorrectly in diagnostic groups, and could have resulted in a compiler crash when those diagnostic groups were mapped. Fixes <rdar://problem/12044436> llvm-svn: 161389
* TableGen: Remove extraneous \ character from arm_neon.h definitions.Jim Grosbach2012-08-031-1/+1
| | | | llvm-svn: 161244
* Remove an unused headerMichael Han2012-07-191-1/+0
| | | | llvm-svn: 160492
* Re-apply r159875 with fixes.Ted Kremenek2012-07-071-10/+229
| | | | | | | - Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32 - Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic. llvm-svn: 159892
* Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement ↵NAKAMURA Takumi2012-07-071-228/+10
| | | | | | | | | | -Weverything." It broke several builds. I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test. > 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp llvm-svn: 159886
* Implement -Wpedantic and --no-pedantic to complement -Weverything.Ted Kremenek2012-07-061-10/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces some magic in tablegen to create a "Pedantic" diagnostic group which automagically includes all warnings that are extensions. This allows a user to suppress specific warnings traditionally under -pedantic used an ordinary warning flag. This also allows users to use #pragma to silence specific -pedantic warnings, or promote them to errors, within blocks of text (just like any other warning). -Wpedantic is NOT an alias for -pedantic. Instead, it provides another way to (a) activate -pedantic warnings and (b) disable them. Where they differ is that -pedantic changes the behavior of the preprocessor slightly, whereas -Wpedantic does not (it just turns on the warnings). The magic in the tablegen diagnostic emitter has to do with computing the minimal set of diagnostic groups and diagnostics that should go into -Wpedantic, as those diagnostics that already members of groups that themselves are (transitively) members of -Wpedantic do not need to be included in the Pedantic group directly. I went back and forth on whether or not to magically generate this group, and the invariant was that we always wanted extension warnings to be included in -Wpedantic "some how", but the bookkeeping would be very onerous to manage by hand. -no-pedantic (and --no-pedantic) is included for completeness, and matches many of the same kind of flags the compiler already supports. It does what it says: cancels out -pedantic. One discrepancy is that if one specifies --no-pedantic and -Weverything or -Wpedantic the pedantic warnings are still enabled (essentially the -W flags win). We can debate the correct behavior here. Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp that determine whether to include the "-pedantic" flag in the warning output. This is no longer needed, as all extensions now have a -W flag. This patch also significantly reduces the number of warnings not under flags from 229 to 158 (all extension warnings). That's a 31% reduction. llvm-svn: 159875
* Implement AST classes for comments, a real parser for Doxygen comments and aDmitri Gribenko2012-07-061-0/+6
| | | | | | | | | | | | | | very simple semantic analysis that just builds the AST; minor changes for lexer to pick up source locations I didn't think about before. Comments AST is modelled along the ideas of HTML AST: block and inline content. * Block content is a paragraph or a command that has a paragraph as an argument or verbatim command. * Inline content is placed within some block. Inline content includes plain text, inline commands and HTML as tag soup. llvm-svn: 159790
* clang/utils/TableGen/ClangAttrEmitter.cpp: Fix abuse of StringRef (from ↵NAKAMURA Takumi2012-07-031-1/+1
| | | | | | getValueAsString()). llvm-svn: 159662
* Fix a thinko and a stray debugging hunk in my attributes patch. Thanks to JordanAlexis Hunt2012-06-201-3/+0
| | | | | | Rose and Richard Smith for catching these. llvm-svn: 158826
* Reapply r158700 and fixup patches, minus one hunk that slipped through andAlexis Hunt2012-06-191-55/+43
| | | | | | | caused a crash in an obscure case. On the plus side, it caused me to catch another bug by inspection. llvm-svn: 158767
* Revert r158700 and dependent patches r158716, r158717, and r158731.Jakob Stoklund Olesen2012-06-191-43/+55
| | | | | | | | The original r158700 caused crashes in the gcc test suite, g++.abi/vtable3a.C among others. It also caused failures in the libc++ test suite. llvm-svn: 158749
* Remove redundant uses of SmallStringAlexis Hunt2012-06-191-7/+3
| | | | llvm-svn: 158731
* Stop abusing StringRef. Fixes the Windows build.Alexis Hunt2012-06-191-12/+12
| | | | | | | I've also removed the duplicate check for PARSED_ATTR since it seems unnecessary, and would have made the code more complicated. llvm-svn: 158716
OpenPOWER on IntegriCloud