summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | Require CLANG_RESOURCE_DIR to be found to build CastXMLBrad King2015-05-131-5/+16
| | | | | | | | | | | | | | CastXML cannot function correctly without Clang resources, so fail with an error from CMake if they cannot be found. GitHub-Issue: 12
* | Output: Add mangled="" attributes to function and variable declsBrad King2015-05-1252-96/+128
| | | | | | | | | | | | The gccxml output format includes mangled="" attributes on almost all elements. Clang only defines mangling for function and variable declarations. Add mangled attributes to castxml output where possible.
* | Output: Drop 'const' from clang::ASTContext referenceBrad King2015-05-122-3/+3
| | | | | | | | This will allow use of non-const methods on it.
* | Output: Inline PrintNameAttribute overload at only call siteBrad King2015-05-121-11/+4
| | | | | | | | | | The NamedDecl overload of this method has only one caller. Just inline the method overload there so that only one overload remains.
* | Output: Fix compilation with VS 2012Brad King2015-04-281-9/+19
| | | | | | | | | | VS 2012 does not support 'explicit' conversion operators or initialization of fields at their declaration.
* | Output: Drop unused index previously consumed by CvQualifiedType elementsBrad King2015-04-2816-99/+97
| | | | | | | | | | | | | | | | Refactoring in the parent commit removed the need to consume a node index when creating a CvQualifiedType element. That commit preserved the behavior artificially in order to minimize differences in expected test output. Now remove this behavior and update the expected test output to account for the now-contiguous indexes.
* | Output: Refactor generation of CvQualifiedType elementsBrad King2015-04-2843-234/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously our handling of cv-qualified types did not account for multiple locally cv-qualified types encountered through multiple levels of desugaring. This could lead to CvQualifiedType elements that reference elements that are generated with a different id. Refactor our internal representation of dump nodes to keep cv-qualifiers in the node ids. Teach AddTypeDumpNode to collect cv-qualifiers from each level of desugaring and compute their union. Once the desugared unqualified type is found, generate one CvQualifiedType element for the qualified type, if any. Update the expected test output to account for the new ordering of nodes. Mark the Class-template-constructor-template test case as no longer broken because this approach fixes it. Add test cases covering cv-qualifiers added at different layers of desugaring (via "T const" where T is already a "const" type in a template instantiation). GitHub-Issue: 10
* | test: Add option to transform actual xml to expected xmlBrad King2015-04-281-0/+12
| | | | | | | | | | | | | | If TEST_UPDATE is set in the environment and a test fails, transform the actual xml output into the expected xml and overwrite the .xml.txt file containing the latter. This will help make sweeping updates to the expected test output when sweeping output format changes are made.
* | Output: Rename AddDumpNode overloads to Add{Decl,Type}DumpNodeBrad King2015-04-271-32/+35
| | | | | | | | | | | | No code needs the compiler to select an overload. We can simply spell it out explicitly to make manual searching for calls of each easier.
* | castxml: Document example values for --castxml-cc-<id> optionBrad King2015-04-162-2/+9
| | | | | | | | | | | | | | Also make the --help output more consistent with the wording in the castxml(1) manual. GitHub-Issue: 7
* | Detect: Improve target triple selectionBrad King2015-04-161-15/+13
| | | | | | | | | | | | | | Use llvm::Triple to compute the triple string for us. Start with the builtin default triple and modify its components based on what we find in the detected preprocessor definitions. Then recompose the final target triple.
* | README: Can be built against LLVM/Clang 3.6.0.Matt McCormick2015-04-101-2/+4
| |
* | Output: Add "size" and "align" attributes on builtin types and structsMichka Popoff2015-04-0872-140/+164
| | | | | | | | | | | | This information is produced by gccxml, so add it to our output too. Since we don't know the architecture that will be targeted during testing, match any size and align values with "[0-9]+".
* | Output: Generate an "offset" attribute on Field elementsMichka Popoff2015-04-089-10/+20
| | | | | | | | This information is produced by gccxml, so add it to our output too.
* | Output: Handle function types with no prototypeBrad King2015-03-314-13/+24
| | | | | | | | | | | | | | | | | | | | | | A FunctionType may be either FunctionProtoType or FunctionNoProtoType. Check that runtime downcasts to FunctionProtoType succeed before using them. For FunctionNoProtoType we will simply output the type "int()", which is compatible with gccxml format (gccxml never lacked prototypes because it always operates in C++ mode). In CastXML we can encounter functions with no prototype in C++ modes when traversing Clang buildins. GitHub-Issue: 1
* | test: Print command line string when a test failsBrad King2015-03-311-0/+2
| | | | | | | | This will make it easy to re-run the command by hand for debugging.
* | README: Add link to CastXML mailing listBrad King2015-03-261-0/+7
| |
* | NOTICE: Update copyright year rangeBrad King2015-03-261-1/+1
| | | | | | | | We've made modifications in 2015.
* | Port to LLVM/Clang SVN r232962 (trunk)Brad King2015-03-234-10/+9
| | | | | | | | | | | | | | | | Clang renamed clang::DeclContext::{lookup_const_result => lookup_result}. Use "auto" to automatically match either of these. Update test expected output to match the lack of throws="" on destructors in C++98 mode.
* | Output: Simplify name lookup result traversalBrad King2015-03-231-7/+6
| | | | | | | | Use a range-based for loop instead of explicit iterators.
* | Output: Traverse namespace redeclarationsBrad King2015-03-236-1/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A namespace may be redeclared to add more members: namespace ns { void f1(); } namespace ns { void f2(); } Fix our AST traversal to consider members from all redeclarations of each namespace instead of only the canonical (first) one. Previously we generated members from later redeclarations only if they were referenced from other declarations we happened to encounter. Reported-by: Michka Popoff <michkapopoff@gmail.com>
* | Output: Refactor PrintMembersAttribute steps as overloadsBrad King2015-03-231-1/+6
| | | | | | | | | | | | Separate collection of the members of a given context from printing of the attribute. This will allow the attribute to be printed with members collected by other means.
* | Detect: Provide __float128 when simulating GNU compilersBrad King2015-02-256-0/+58
| | | | | | | | | | | | | | GNU compilers provide a __float128 builtin type on Intel architectures. When simulating such GNU compiler preprocessing, define a __float128 type with the expected size and alignment in case the translation unit references it.
* | Detect: Use local variable to simplify fixPredefines logicBrad King2015-02-251-4/+5
| |
* | test: Add infrastructure to run tests against real GNU compilersBrad King2015-02-251-0/+36
| | | | | | | | | | Find gcc and g++ tools on the local system to use for running tests for simulating real compilers with --castxml-cc-gnu.
* | test: Default to requiring empty stdout and stderrBrad King2015-02-2532-31/+2
| |
* | test: Fix Function-template source to return from startBrad King2015-02-251-1/+1
| | | | | | | | | | Fix the start() function in test/input/Function-template.cxx to actually return a value from its implementation.
* | Detect: Do not use Clang builtin include dir with --castxml-cc-msvcBrad King2015-02-113-4/+2
| | | | | | | | | | | | | | | | | | In commit 8d8aacd6 (Detect: Use Clang builtin include dir even with --castxml-cc-<id>, 2015-02-04) we added the Clang builtin include dir to the beginning of the include path detected by --castxml-cc-msvc. However, since we use only the detected predefined macros and not those builtin to Clang, the Clang builtin headers cannot be included safely. Revert that part of the commit for now.
* | Detect: Drop detected predefined macros starting in '__has'Brad King2015-02-047-4/+34
| | | | | | | | | | These macros are builtin to Clang so we should not try to use any such definitions detected from the compiler.
* | Detect: Use Clang builtin include dir even with --castxml-cc-<id>Brad King2015-02-048-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need implementation-provided headers to come from Clang to match what is really built in to the parser. When not using --castxml-cc-<id>, the Clang driver adds its builtin include directory in methods like Linux::AddClangSystemIncludeArgs MSVCToolChain::AddClangSystemIncludeArgs CrossWindowsToolChain::AddClangSystemIncludeArgs (see lib/Driver/*ToolChain*.cpp). When using --castxml-cc-<id>, we must add the Clang builtin include dir in the appropriate place. GNU-like compilers should have a builtin include directory too, providing files like <emmintrin.h>. The Clang driver does not add this directory from GCC toolchains and instead adds its own builtin include directory. In this case, replace the detected compiler builtin include directory with ours. MSVC-like compilers have no separate builtin include directory. The Clang driver simply places its own builtin include direcory before the system include directory read from the INCLUDE environment variable. In this case, do the same.
* | test: Add a case to test that -c is ignoredGaëtan Lehmann2015-02-033-0/+3
| | | | | | | | | | | | | | The '-c' option is required to use castxml with ccache to tell ccache that we are compiling rather than linking. In castxml we already ignore the option when used with --castxml-gccxml, so add a test case to ensure the behavior is preserved in the future.
* | castxml: Allow -E to suppress --castxml-gccxml when used togetherGaëtan Lehmann2015-01-287-13/+6
| | | | | | | | | | | | | | | | | | | | | | This helps make castxml usable with ccache. In its first pass, ccache drops the -o and the output file from the command line and add the -E option to get the preprocessed output. It does not now about --castxml-gccxml, so castxml must not produce an error when the options are used together. Instead make -E suppress --castxml-gccxml, much like compilers do for -E and -c together. Co-Author: Brad King <brad.king@kitware.com>
* | castxml: Add creditsBrad King2014-12-172-1/+9
| |
* | README: Add creditsBrad King2014-12-171-0/+9
| |
* | Output: Fix references to cv-qualified types encountered indirectlyBrad King2014-12-115-16/+59
| | | | | | | | | | | | | | | | | | | | | | | | Teach AddDumpNode to optionally report back the actual QualType that it selects after possibly unwrapping some layers of indirection in the Clang AST. Use this in GetTypeIdRef so that we check this actual QualType's cv qualifiers instead of the original QualType. Otherwise we may generate a dangling reference to the id number that is replaced by a CvQualifiedType id. Fix the expected output of existing test cases that exhibit this problem and add a new test case designed to cover the behavior explicitly.
* | test: Improve class template member typedef test casesBrad King2014-12-114-6/+6
| | | | | | | | Reference the template parameter type as the typedef'd type.
* | RunClang: Force definition only of special membersBrad King2014-12-101-4/+19
| | | | | | | | | | | | Only special members may be implicit, and only implicit members may be left undeclared. Avoid spending the time to mark other members referenced.
* | RunClang: Use queue to track class completionBrad King2014-12-081-3/+6
| | | | | | | | | | | | When adding implicit members more classes may be completed. Use a queue to follow this cleanly instead of allowing a vector to be reallocated during range interation.
* | RunClang: Do not add implicit members if errors occurredBrad King2014-12-081-5/+7
| | | | | | | | | | | | If there are errors in the actual input translation unit, do not bother trying to extend it with implicit members because we will not generate output anyway.
* | RunClang: Refactor definition of implicit membersBrad King2014-12-087-36/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use clang::Sema::PerformPendingInstantiations before we attempt to add implicit member definitions so any real errors show up first. Then set SuppressAllDiagnostics to suppress errors caused by the following. Iterate over all members of one class at a time in order of completion of class definition (bases before derived classes). Force definition of each member using clang::Sema::MarkFunctionReferenced followed by another call to clang::Sema::PerformPendingInstantiations to ensure that members formed by implicitly instantiated templates are completed. Clang will mark any failed declaration as invalid, allowing us to exclude it from the output. This works both for implicit and explicit members. Update the test suite to mark test cases that are no longer 'broken'. According to discussion on the Clang cfe-commits mailing list: [PATCH] Add DiagnosticSuppressionScope RAII class http://thread.gmane.org/gmane.comp.compilers.clang.scm/110832/focus=111112 this approach may depend on non-guaranteed behavior. By iterating over members in order of class definition, we mark any bad special members invalid in base classes so that when Clang processes those in derived classes the invalid members are only one "step" away. Hopefully this behavior will be easier to preserve if Clang changes in the future.
* | RunClang: Delay class implicit members until end of parsingBrad King2014-12-082-26/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Tell Clang to enable incremental processing so that it does not tear down the parser when EOF is reached. In HandleTagDeclDefinition, queue completed classes for later processing instead of adding class implicit members immediately. Then add implicit members at the end and finally call clang::Sema::ActOnEndOfTranslationUnit to tear down the parser when we are done. This approach allows Clang to finish parsing the translation unit without interference from our custom implicit member behavior. Fix the expected output of the Class-bases test in c++11 mode to match the new order of the implicit members.
* | Port to LLVM/Clang SVN r223652 (trunk)Brad King2014-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | No changes needed. Simply record that we have tested with the newer version. This version fixes problems with delayed template parsing, incremental processing, and diagnostic suppression that we need to fix some of our 'broken' test cases. In particular, we need these: * r220400 - Fix late template parsing leak with incremental processing, 2014-10-22. * r223525 - Make DiagnosticErrorTrap work even if SuppressAllDiagnostics is enabled, 2014-12-05.
* | Avoid if() auto-dereference of quoted argumentBrad King2014-12-081-1/+1
| | | | | | | | | | | | | | When testing CMAKE_CXX_COMPILER_ID, do not explicitly dereference the variable. Instead let if() do it in an unquoted argument. This avoids CMP0054 warnings on MSVC.
* | Merge branch 'upstream-kwsys'Brad King2014-11-1211-291/+443
|\ \ | |/
| * KWSys 2014-11-12 (5843f590)KWSys Robot2014-11-1211-291/+443
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 5843f590 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 6aa1f800..5843f590 Ben Boeckel (12): 9bf03363 Avoid if() quoted auto-dereference 771e0f22 DynamicLoader: use strings for arguments 86e20d68 Directory: remove extra define 6cc24510 SystemTools: use strings in environment functions bab5b1f2 SystemTools: add string overload for ReplaceString f3fb01cf SystemTools: use strings for path-related APIs 0dfbe56d SystemTools: use strings for making C identifiers 4690fc8d SystemTools: use strings in registry function 1b762a41 SystemTools: search for characters 4a060347 SystemInformation: use %ls for WCHAR* format specifiers d31f7b12 SystemTools: remove unused variable 5843f590 cmake: remove arguments to endfoo and else commands Brad King (2): 29ffaf43 Suppress deprecation warnings for GetVersionEx 88c8cc7f Fix configure_file call to use COPYONLY, not COPY_ONLY Clinton Stimpson (1): 5bf91dda SystemTools: Use extended length path for copying files. Ådne Hovda (1): 2e4a0ff0 SystemInformation: Check for _SC_AIX_REALMEM before using it Change-Id: Ib4f68d3391c502bc503bde4d6ad582c670392fb8
* | Port to LLVM/Clang SVN r219684 (trunk)Brad King2014-10-1430-102/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Traversal of the clang::driver::JobList entries must now use a range-based for loop. Update expected test output to add throws="" to implicit class members in c++98 mode (which Clang previously missed). First run sed -i 's/artificial="1"/&( throws="")?/' test/expect/*.xml.txt Then split the c++98 and c++11 outputs that have too many throws="" instances for the CMake regex paren limit into separate files. For c++98 we expect throws="" on implicit members. For c++11 we do not.
* | Port to LLVM/Clang SVN r218400 (trunk)Brad King2014-09-242-2/+3
| | | | | | | | | | Traversal of the clang::driver::JobList entries now must use 'const' clang::driver::Command instances.
* | Merge branch 'upstream-kwsys' into src/kwsys/ subtreeBrad King2014-09-2430-624/+1385
|\ \ | |/
| * KWSys 2014-09-19 (6aa1f800)KWSys Robot2014-09-2430-624/+1385
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 6aa1f800 | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 606d7d6f..6aa1f800 Adrien Destugues (1): b1916e0a SystemInformation: Update CPU count code for Haiku Ben Boeckel (26): ef3bfa01 c_str: Don't use .c_str() when streaming strings 9c165368 Glob: Use string comparisons if you have them ready 53ba0bc6 containers: Use .empty() instead of .size() where possible 6cbb57ac strings: Use string methods instead of size calculations e53596b7 RegularExpression: Add string overloads aec9de6a CommandLineArguments: Push the string back, not its C string 1d531416 Glob: Accept a string in Glob::AddFile 81f5e0a8 Glob: Accept a string in Glob::AddExpression d40c2706 SystemTools: Remove redundant if guards c1296f4a SystemTools: Defer computing length until after a .empty() check 7ffb7106 SystemTools: Use the iterator constructor for strings 29e3b1d8 SystemTools: Use .rfind('/') rather than .find_last_of("/") 5eb3a65c SystemTools: Don't construct a string just for its length b07b5fc1 SystemTools: Take a string in GetShortPath 153f6df7 SystemTools: Use strings in ComparePath 2c2f6604 SystemTools: Accept strings in IsSubDirectory 84db9ee5 SystemTools: Take strings in AddTranslationPath 4b409aa4 SystemTools: Take strings in SplitPath d2dbff07 SystemTools: Take strings in CollapseFullPath e9204f8f SystemTools: Take strings in AddKeepPath 3254681a SystemTools: Reserve memory in JoinPath 6074f33f SystemTools: Use static strings in SystemToolsAppendComponents 9927862c SystemTools: more string replacements b3d598b0 strings: remove unnecessary c_str calls ffe94132 SystemTools: use char instead of const char* f29fec7c Directory: accept strings in methods Bob E (1): 697b1401 SystemInformation: No SA_RESTART on QNX Brad King (10): 9c653603 Process: Suppress IBM XL warning about infinite loop in test 88c5a768 Set policy CMP0025 to NEW within KWSys 39f98b5d Encoding: Add self-assignment check to CommandLineArguments 1979c02d hashtable: Poison operator= on internal node type f3a36760 SystemInformation: Include backtrace APIs whenever we use them 2e00d252 SystemTools: Port cygwin path conversion to modern API c282e64f Process: Workaround child kill trouble on Cygwin 4791701a SystemTools: Remove ConvertWindowsCommandLineToUnixArguments method 4d526097 Add assert() to quiet Clang scan-build warnings 80e852f6 kwsysPlatformTests: Use if(DEFINED) to simplify conditions Christian Svensson (1): 32023afd CPU: Add support for OpenRISC 1000 Chuck Atkins (3): e4bba930 Directory: Make sure the /* suffix uses correct slashes 97817ce7 SystemTools: Refactor test file and directory locations 8f991ab0 SystemTools: Use extended paths on Windows for > 256 length Clinton Stimpson (7): 0d8ef429 Encoding: Help enforce the use of wide apis on Windows. cfbc1cc8 FStream: Remove unused basic_filebuf declaration. b3b20cc0 FStream: Add ability to detect BOM. c2a329ce Encoding: Fixes uses of stat() on Windows to work with unicode. 65b36ede Encoding: Fix testProcess to work with unicode paths. 93eb1a1f SystemTools: Improve RelativePath() to handle ./ ../ and // fb77be5a SystemTools: Fix GetCasePathName to handle wildcards on Windows. Gerhard Grimm (1): fa86f1ba SystemInformation: Fix HP-UX PA-RISC processor detection Jiri Malak (2): e66d99b8 SystemTools: Fix compilation with Open Watcom 36982798 SystemTools: add Watcom single Quote processing Matt McCormick (1): b3db597b SystemInformation: Mark EXECINFO_LIB as advanced Rashad M (1): e787837a SharedForward: Cast away const to call execvp on MinGW 64-bit Rolf Eike Beer (3): a8aa1014 SystemInformation: Fix HP-UX Intel processor detection a99a9235 set the compile flags for older HP compilers to fix compilation 8b085635 MD5: avoid casting back and forth between size_t and int Sean McBride (1): 6aa1f800 SystemInformation: Fix clang -Wtautological-pointer-compare warning Stephen Kelly (1): dd873734 SystemTools: Remove some unnecessary c_str() calls Steve Dougherty (1): 5f28a52b Terminal: Fix spelling of 'definitely' in comments Change-Id: If23ebc713411e1eee3a7951bd2bf56e75c7b6bb6
* | Port to LLVM/Clang SVN r216182 (trunk)Brad King2014-08-211-1/+1
| | | | | | | | | | No changes needed. Simply record that we have tested with the newer version. The previous version r216002 did not build on MSVC.