summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* castxml: Fix `__float128` simulation with `-std=gnu++{11,14}`Brad King2016-01-262-5/+18
| | | | | | | | | | | | | | | | | | | | | Since LLVM/Clang does not natively support the `__float128` GNU extension CastXML inserts its own preamble declaring the name as a typedef to a struct that we handle specially during output. This allows us to support `--castxml-cc-gnu g++` preprocessor conditions that cause code to use `__float128`. However, when Clang has GNU extensions enabled with C++11 or later it adds its own fake `__float128` builtin type in order to tolerate the type while parsing. These two workarounds conflict, leading to: error: typedef redefinition with different types ('struct __castxml__float128' vs '__float128') Fix this by skipping our own typedef for `__float128` when we expect Clang to provide its own fake builtin type. Then teach our output code to recognize the Clang builtin and replace it with FundamentalType just as we do for or own struct `__castxml__float128`. GitHub-Issue: 44
* Output: Fix `__float128` mangled name suppression with MSVC manglingBrad King2016-01-262-4/+4
| | | | | | | Suppress mangled name output for any name containing `__float128` so it works for both GNU and MSVC mangling conventions. Rename the struct `__castxml_float128` to `__castxml__float128` so that the full name of the type always appears.
* Output: Factor out a helper to print our fake __float128 FundamentalTypeBrad King2016-01-251-3/+11
|
* RunClang: Pass CompilerInstance to UpdatePredefinesBrad King2016-01-251-3/+4
| | | | | | Teach UpdatePredefines to ask the CompilerInstance for the predefines. This will allow it to ask the CompilerInstance for other information too.
* RunClang: Adopt logic to add fake __float128 builtinBrad King2016-01-252-16/+21
| | | | | | Delay the decision until we are constructing the final list of builtins when the Clang CompilerInstance is available. This will allow us to adapt based on the compiler language mode.
* RunClang: Refactor preprocessor definition searchesBrad King2016-01-251-8/+9
| | | | | Use std::string::find instead of strstr when we do not actually need to extract the found content as a C string.
* Output: Fix references to types whose declaration is invalidBrad King2015-12-141-8/+9
| | | | | | | | | | | | We skip generating declarations that Clang has deemed invalid. Most callers of AddDeclDumpNode can check the return value and handle the lack of a valid decl. However, callers of AddDeclDumpNodeForType are generating references to types and expect to get a valid element to reference. We can get an invalid RecordDecl when it is a template instantation that fails (but does not otherwise produce a compilation error in Clang). References to types corresponding to the invalid RecordDecl must remain valid, so generate a Class/Struct/Union element anyway and simply leave out class members and bases.
* Output: Clarify name of method adding a decl for a typeBrad King2015-12-141-8/+10
| | | | | Rename the AddDeclDumpNode that is used to add declarations for a type to AddDeclDumpNodeForType for clarity.
* Output: Skip C++11 type alias declarationsBrad King2015-12-101-0/+8
| | | | The gccxml output format may contain only C++98 constructs.
* Output: Skip Typedef elements that refer to rvalue referencesBrad King2015-12-101-0/+7
| | | | The gccxml output format may contain only C++98 constructs.
* Output: Generate Base element offset="" attributeBrad King2015-12-031-1/+10
| | | | | | | | The gccxml output format had this attribute, defined by GCC as "The offset where this basetype appears in its containing type". This is well-defined only for non-virtual base classes. GitHub-Issue: 34
* Add predefined macros for versions of CastXML and internal ClangBrad King2015-12-031-0/+23
| | | | | | | Some translation units may need to know the real tool that is performing the preprocessing even when --castxml-cc-<id> switches predefined macros to those from another compiler. Provide dedicated version macros for both CastXML and the internal Clang against which it is built.
* RunClang: Refactor built-in predefines substitutionBrad King2015-12-031-13/+19
| | | | | | Always split the predefines string into a prefix, body of actual builtins, and suffix. Replace the body with builtins detected from --castxml-cc-<id>, if given.
* Utils: Add function to get version value encoded as an integerBrad King2015-12-032-0/+11
|
* Version: Add macros for individual version componentsBrad King2015-12-032-0/+15
|
* Version: Clarify name of version string macroBrad King2015-12-032-2/+2
|
* castxml: Link to LLVMSupport libraryBrad King2015-09-231-0/+1
| | | | | | | | We include LLVM support headers and use the APIs, so we should link to the corresponding library directly instead of depending on a transitive dependency through other libraries we use. GitHub-Issue: 30
* RunClang: Detect C and C++ std level from --castxml-cc-<id>Brad King2015-09-183-2/+95
| | | | | | | | If no -std= option is explicitly given then parse the __cplusplus or __STDC_VERSION__ preprocessor definition from the compiler output and add the corresponding -std= flag. For MSVC we need to map _MSC_VER to -std= ourselves because the compiler does not define __cplusplus to standard values and each version hard-codes its C++ standard level.
* castxml: Allow --castxml-cc-<id> to detect C language settingsBrad King2015-09-182-12/+20
| | | | | | If the "<id>" is "gnu-c" or "msvc-c" then run the given compiler command line on a C source file instead of C++. This allows C language settings of the given compiler to be detected.
* RunClang: Exit with error if compiler invocation argument parsing failsBrad King2015-09-181-0/+3
| | | | | If an error occurs during CompilerInvocation::CreateFromArgs then exit with an error code immediately.
* castxml: Support -std=c++14 with --castxml-gccxmlBrad King2015-09-021-4/+0
| | | | | | | | Drop the rejection of -std=c++14 and --castxml-gccxml together. Extend the test suite to run all gccxml output format tests in -std=c++14 mode to verify the behavior of the mode is as close as possible to other modes. For the few tests that have c++11-specific expected output, use it for c++14 expected output too.
* Port to LLVM/Clang SVN r245954 (trunk)Brad King2015-08-251-1/+4
| | | | | Since LLVM r244854 there is no BumpPtrStringSaver, but StringSaver can be constructed with a BumpPtrAllocator.
* Output: Add overrides="" attribute to methodsJörg Wollenschläger2015-08-251-0/+18
| | | | The gccxml output format had this attribute.
* Output: Add annotate() to more declaration attributes=""Jörg Wollenschläger2015-08-241-3/+19
| | | | | | | Extend the change from commit e73fba54 (Output: Add annotate() to function declaration attributes="", 2015-08-18) to support record, enum, field, variable, and typedef since gccxml also supported attributes in these.
* KWSys: Remove source "CTestCustom.cmake.in" not used by CastXMLBrad King2015-08-201-15/+0
|
* Merge branch 'upstream-kwsys'Brad King2015-08-2012-1359/+1395
| | | | | Resolve conflicts in files that we previously removed from our side by removing them again.
* KWSys: Drop portions not used by CastXMLBrad King2015-08-2068-26348/+9
| | | | | | | We have KWSys in CastXML only for the Process execution library, and will drop it if an alternative becomes available in LLVM. Add CastXML-specific conditions to src/kwsys/CMakeLists.txt to turn off the parts we do not use. Also drop the corresponding source files.
* Include KWSys Configure.h instead of Configure.hxxBrad King2015-08-203-3/+3
| | | | We do not need any of the settings from the latter.
* Utils: Avoid use of KWSys SystemToolsBrad King2015-08-201-11/+15
| | | | Use llvm::sys instead.
* Utils: Avoid use of KWSys SystemTools::GetLineFromStreamBrad King2015-08-201-4/+4
| | | | Use std::getline instead.
* RunClang: Avoid use of KWSys SystemToolsBrad King2015-08-201-4/+4
| | | | Use llvm::sys instead.
* Detect: Avoid use of KWSys SystemTools::FileExistsBrad King2015-08-201-3/+2
| | | | Use llvm::sys::fs::exists instead.
* Detect: Avoid use of KWSys SystemTools::SplitBrad King2015-08-201-6/+8
| | | | Use llvm::StringRef::split instead.
* Detect: Avoid use of KWSys SystemTools::GetEnvBrad King2015-08-201-1/+2
| | | | Use std::getenv instead.
* Detect: Avoid use of KWSys SystemTools::ConvertToUnixSlashesBrad King2015-08-201-2/+3
| | | | | We do not need the full conversion performed by ConvertToUnixSlashes. Simply use std::replace to convert backslashes to forward slashes.
* Output: Add annotate() to function argument attributes=""Michka Popoff2015-08-201-0/+3
| | | | | | Extend the change from commit e73fba54 (Output: Add annotate() to function declaration attributes="", 2015-08-18) to function arguments since gccxml also supported attributes there.
* Output: Add annotate() to function declaration attributes=""Brad King2015-08-181-0/+14
| | | | | | | | | While CastXML cannot support the `gccxml()` attribute because Clang does not define it, we can support the `annotate()` attribute that Clang provides for arbitrary string annotations. This should fill the same use case as the `gccxml()` attribute did for clients. GitHub-Issue: 25
* Output: Refactor attributes="" printing to use a helperBrad King2015-08-181-9/+35
| | | | | Add a PrintAttributesAttribute helper and use it anywhere we currently print the attributes="" attribute.
* RunClang: Exit with error if compilation jobs fail to buildBrad King2015-08-071-0/+3
| | | | | | | | If an error occurs during Driver::BuildCompilation then exit with an error code immediately. This is important when an input file is missing, for example. GitHub-Issue: 23
* Port to LLVM/Clang SVN r243888 (trunk) and 3.7Brad King2015-08-031-1/+1
| | | | Use `auto` to adapt to the Compilation::getJobs() return type.
* Port to LLVM/Clang SVN r240941 (trunk)Brad King2015-06-292-0/+23
| | | | | | | Update use of the llvm::opt::OptTable::ParseArgs method and the llvm::cl::ExpandResponseFiles function to account for post-3.6 changes to the LLVM/Clang API. Use preprocessor conditions so that we can continue to build against LLVM/Clang 3.6 too.
* Output: Further hide our __float128 struct from generated xmlBrad King2015-06-242-1/+18
| | | | | | | | | | | | | | | Give the our __float128 struct an internal '__castxml' name so that it can be identified during traversal of member lists. Do not report the struct as a member of the translation unit since the typedef will be generated as a FundamentalType directly. Also generate empty mangled="" attributes for mangled names involving our __float128 struct since the mangled names will not use the "g" that GCC would for the builtin type. Add test cases that do not use --castxml-start. Verify that no test case produces '__castxml' in its output to ensure we always hide such internal details from the generated output. GitHub-Issue: 18
* Output: Add local variable to one case in AddDeclContextMembersBrad King2015-06-231-1/+3
| | | | | Save the CXXRecordDecl downcast in a local variable so we can use it multiple times.
* Output: Generate a FundamentalType for our __float128 typedefBrad King2015-06-231-0/+16
| | | | | | | | | | | | GNU compilers have a builtin __float128 type but Clang does not. Since commit fe1bb977ee (Detect: Provide __float128 when simulating GNU compilers, 2015-02-24) we define __float128 as a typedef in the preamble referencing a struct with the proper size and alignment. Avoid exposing this implementation detail to clients by generating a FundamentalType element as a special case when our typedef is encountered. This matches gccxml behavior when __float128 is encountered. GitHub-Issue: 18
* castxml: Teach --castxml-start to support a comma-separated listMichka Popoff2015-06-081-3/+10
| | | | | | | In gccxml one could input a comma-separated list for the starting declarations to parse. Add support for this with tests for cases were a comma-separated list is used, and for the case where --castxml-start is used multiple times.
* castxml: Allow -target option to override --castxml-cc-<id> detectionBrad King2015-05-283-2/+9
| | | | | | | If the command line contains an explicit '-target' option then do not consider the target platform detected from any --castxml-cc-<id> option. Instead simply honor the explicitly requested target. This will be particularly helpful for targets that CastXML has not learned to detect.
* Output: Move function type attributes to end of element attribute listBrad King2015-05-271-1/+1
| | | | | | | Function type attributes like attributes="__thiscall__" are specific to the architecture and so may need to be filtered during testing. Move them to be the last xml attribute in their element to make filtering easier.
* Output: Generate throw="..." instead of throws="..."Michka Popoff2015-05-211-2/+2
| | | | | | Original gccxml output used the singular name, so we should too for compatibility. Fix this typo left from commit defc576826 (Output: Generate Function and related elements, 2014-02-12).
* Output: Place inline namespace members in containing namespaceBrad King2015-05-151-0/+18
| | | | | | | | | | | | | | | | | | An inline namespace affects the linkage of its members but for APIs the members are effectively in the containing namespace. Generate output as if they were really in the containing namespace and do not generate a Namespace element for an inline namespace. If --castxml-start names an inline namespace simply ignore it to avoid dumping a Namespace element for it. One can argue this is valid since the inline namespace should not normally be named in API usage. Set our printing policy to avoid showing the inline namespace component automatically. Note that expressions in the source code that hard-code the inline namespace name will still be preserved and show the inline namespace when printed (e.g. Variable init="" attribute expressions). Suggested-by: Michka Popoff <michkapopoff@gmail.com>
* Output: Refactor Clang printing policy selectionBrad King2015-05-151-5/+10
| | | | Store our printing policy in a member up front.