summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* | Port to LLVM/Clang SVN r216002 (trunk)Brad King2014-08-206-5/+5
| | | | | | | | Rename 'c++1y' to 'c++14'.
* | Port to LLVM/Clang SVN r215464 (trunk)Brad King2014-08-122-4/+6
| | | | | | | | | | | | The clang::FrontendAction::CreateASTConsumer method now returns std::unique_ptr<clang::ASTConsumer>, so update our override to return the same type. While at it, mark our declaration with 'override'.
* | Port to LLVM/Clang SVN r215430 (release_35)Brad King2014-08-124-10/+10
| | | | | | | | | | | | Use std::error_code instead of llvm::error_code. Use std::unique_ptr instead of llvm::OwningPtr. Use llvm_map_components_to_libnames instead of llvm_map_components_to_libraries.
* | Port to LLVM/Clang SVN r210479Brad King2014-06-092-2/+2
| | | | | | | | | | The clang::driver::Driver constructor no longer takes a default image name.
* | test: Add cases for --castxml-cc-(gnu|msvc) detectionBrad King2014-04-1621-0/+68
| | | | | | | | | | | | Create dummy gnu-like and msvc-like compiler binaries. Use them with the --castxml-cc-<id> options to verify that the preprocessor definitions and include directories are detected as expected.
* | RunClang: With --castxml-cc-<id>, disable Clang stdlib includesBrad King2014-04-161-1/+2
| | | | | | | | | | | | | | | | Tell Clang not to add its own standard library include directories when we are simulating another compiler. Pass -nobuiltininc and -nostdlibinc to suppress all directories that Clang might add. Do not pass -nostdinc because that may prevent Clang code from ever checking for -nostdlibinc and then it would warn that the argument is not used.
* | Detect: Recognize framework include directories on OS XBrad King2014-04-163-6/+29
| | | | | | | | | | | | | | | | Some OS X compilers report their framework include directories with an explicit suffix in "-v" output. Others report without an explicit suffix but the paths imply they are for frameworks by ending in "/Frameworks". Recognize either suffix and remove the explicit suffix. Add framework directories with "-iframework" instead of "-isystem".
* | Output: Add function calling convention attributesBrad King2014-04-144-0/+61
| | | | | | | | | | Add to Function-like and FunctionType elements an attributes="" attribute for the calling convention as gccxml does.
* | Output: Generate location attributes for builtin declarationsBrad King2014-04-114-11/+37
| | | | | | | | | | | | Report a file id "f0" named "<builtin>" for declarations that are generated by the compiler and have no reference location in the source. Add a test case covering the MSVC builtin "size_t" typedef.
* | Output: Traverse extern "C" namespace membersBrad King2014-04-114-0/+23
| | | | | | | | Teach AddDeclContextMembers to recurse on LinkageSpecDecl members.
* | Output: Refactor declaration context traversalBrad King2014-04-111-52/+64
| | | | | | | | | | Factor new method AddDeclContextMembers out of PrintMembersAttribute. It will need to become recursive to support LinkageSpecDecl members.
* | Output: Drop class template partial specializations from outputBrad King2014-04-116-1/+49
| | | | | | | | | | | | | | Since gccxml format does not support uninstantiated templates we must not output any partial specializations either. Skip class template partial specializations when traversing context members. Desugar non-dependent typedef members of class template partial specializations.
* | Output: Drop functions with rvalue reference types from gccxml outputBrad King2014-04-1112-11/+59
| | | | | | | | | | | | | | | | | | | | | | Improve support for -std=c++11 with --castxml-gccxml by dropping all functions and class methods whose signature contains a rvalue reference. This subsumes the previous check for implicit move constructors and implicit move assignment operators and extends it to explicitly written declarations too. Add test cases to verify that such declarations are excluded from the output.
* | Output: Order queue deterministically by node indexBrad King2014-04-119-16/+20
| | | | | | | | | | | | | | | | | | | | Use a set<> instead of a queue<> to represent the output node queue. Order nodes by the dump node index. The index is the same as the order of encounter so for complete nodes this should normally be the same order as before. However, QueueIncompleteDumpNodes previously ordered based on memory position which is not deterministic. Use the node index to get a consistent order across runs. Fix the expected output for test cases that changed the order of incomplete nodes.
* | castxml: Register all LLVM target architectures and asm parsersBrad King2014-04-105-1/+27
| | | | | | | | | | We need as parsers to support Visual Studio system header files that contain inline assembly.
* | castxml: Support -std=c++11 with --castxml-gccxmlBrad King2014-04-1013-9/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parsing standard library headers in Visual Studio 11 and above requires Clang to use -std=c++11 because the headers use C++11 constructs. While gccxml output format does not support these constructs, it is still useful to be able to output interfaces from C++98 project code while tolerating C++11 constructs in system headers. Drop the rejection of -std=c++11 and --castxml-gccxml together. Teach our ASTVisitor::AddDumpNode method to skip deleted member functions, implicit move constructors, and implicit move assignment operators. This should avoid encountering any C++11 constructs that are not written explicitly in the translation unit. Extend the test suite to run all gccxml output format tests in both -std=c++98 and -std=c++11 mode to verify the behavior of the two modes is as close as possible. Tweak the Class-implicit-members expected output to tolerate the empty throw specification missing in C++11 mode. Add a RValueReferenceType test to verify that the gccxml-format output contains an Unimplemented element for the rvalue-reference type.
* | test: Split gccxml test macros by language and standardBrad King2014-04-091-3/+15
| | | | | | | | | | Factor out macros to add tests by individual language standard from those that cover a group of language standards.
* | test: Name expected results by language standardBrad King2014-04-09126-7/+7
| | | | | | | | | | | | Name files "gccxml.<std>.<test>.(stdout|stderr|result|xml).txt" where "<std>" is either the language standard or "any" if the result works for any standard.
* | test: Support zero or many alternative expected result file namesBrad King2014-04-092-7/+10
| | | | | | | | | | | | Teach test/run.cmake to loop over a list of possible expected result names. This will allow tests results to be specialized in certain cases without duplicating common results.
* | test: Refactor castxml_test_gccxml_common 'std' argumentBrad King2014-04-091-4/+4
| | | | | | | | Pass just the standard name and hard-code '-std=' in the implementation.
* | Output: Pass full Options struct to our ASTVisitorBrad King2014-04-093-12/+16
| | | | | | | | | | Pass the full structure instead of just the StartNames field. We may need information about other options later.
* | RunClang: Pass full Options struct to our ASTConsumerBrad King2014-04-091-5/+5
| | | | | | | | | | Pass the full structure instead of just the StartNames field. We may need information about other options later.
* | test: Remove xml output files before running castxmlBrad King2014-04-091-0/+4
| | | | | | | | | | Ensure that test output is produced by castxml and not left from a previous test run.
* | test: Show failure when implicit member needs bad template instantiationBrad King2014-04-095-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a function template (or member of a class template) is instantiated by an implicit class member definition, Clang delays the instantiation for later handling by clang::Sema::PerformPendingInstantiations during clang::Sema::ActOnEndOfTranslationUnit. If the instantiation causes errors they are not suppressed because our clang::Sema::SFINAETrap has gone out of scope. Even if we could keep a clang::Sema::SFINAETrap in scope, the clang::Sema::InstantiatingTemplate::Initialize method sets sema.InNonInstantiationSFINAEContext to false and adds an entry to sema.ActiveTemplateInstantiations. This prevents the clang::Sema::EmitCurrentDiagnostic call to isSFINAEContext from returning a valid SFINAE context, so errors are still not suppressed. Add a test case demonstrating this known failure, and mark it as "broken". This will require changes to Clang to fix.
* | Port to LLVM/Clang SVN r205446Brad King2014-04-083-7/+9
| | | | | | | | | | | | | | Build with compiler flag '-std=c++11' since the Clang API now uses C++11. Update our implementation to account for Clang API changes. Update our search for the Clang resource directory to include the LLVM/Clang version patch level.
* | README: Add 'Build' sectionBrad King2014-04-081-0/+43
| | | | | | | | | | List the prerequisites and provide basic build instructions. In particular, state the version of LLVM/Clang that has been tested.
* | README: Add 'License' sectionBrad King2014-04-081-0/+8
| | | | | | | | | | State the license by name and link to a URL where it is published. Also link to our LICENSE and NOTICE files.
* | README: Organize section headersBrad King2014-04-081-1/+4
| |
* | RunClang: Add missing include for OwningPtrBrad King2014-04-031-0/+1
| | | | | | | | Include the LLVM header for OwningPtr before using it.
* | Output: Skip empty declarations in class or namespace membersBrad King2014-04-014-0/+12
| | | | | | | | Clang creates an "EmptyDecl" for a stray semicolon. Ignore it.
* | doc: Write 'castxml(1)' manualBrad King2014-04-011-0/+57
| |
* | doc: Add documentation infrastructure based on SphinxBrad King2014-04-017-0/+191
| | | | | | | | | | | | Create a 'doc' directory and placeholder 'doc/manual/castxml.1.rst' manual. Search for sphinx-build and use it to generate html and man pages. Install them based on CastXML_INSTALL_(DOC|MAN)_DIR variables.
* | castxml: Report help with '-help' and '--help'Brad King2014-04-016-0/+33
| | | | | | | | Also pass the flag through so Clang reports its help too.
* | castxml: Use parentheses for '--castxml-cc-<id>' commandsBrad King2014-03-3110-4/+68
| | | | | | | | | | | | | | | | Avoid requiring the option to be last by using the form --castxml-cc-<id> "(" <cc> <cc-opt>... ")" to specify compiler commands with arguments.
* | castxml: Rewrite usage output to include more detailBrad King2014-03-311-3/+24
| |
* | Output: Skip through extern "C" contexts to enclosing namespaceBrad King2014-03-314-0/+16
| | | | | | | | | | The gccxml output format has no representation for extern "C" declaration contexts, so simply report the enclosing namespace.
* | Output: Skip friend function templatesBrad King2014-03-314-0/+36
| | | | | | | | | | The gccxml output format does not support uninstantiated templates so we need to skip friend declarations referencing them.
* | Output: Report template declarations as UnimplementedBrad King2014-03-271-0/+36
| | | | | | | | | | | | In case our traversal accidentally reaches a class or function template due to a bug, generate an Unimplemented element instead of trying to generate a Class-like or Function-like element for a template.
* | test: Use distinct output xml for every testBrad King2014-03-271-1/+2
| | | | | | | | | | | | | | Use the castxml "-o" option to place the test output in a .xml file named for the test instead of the input file. This allows multiple tests to share the same input file base name and still run in parallel without conflict.