| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
Teach UpdatePredefines to ask the CompilerInstance for the predefines.
This will allow it to ask the CompilerInstance for other information
too.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Use std::string::find instead of strstr when we do not actually need
to extract the found content as a C string.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Rename the AddDeclDumpNode that is used to add declarations for a type
to AddDeclDumpNodeForType for clarity.
|
| |
|
|
| |
The gccxml output format may contain only C++98 constructs.
|
| |
|
|
| |
The gccxml output format may contain only C++98 constructs.
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
If an error occurs during CompilerInvocation::CreateFromArgs then exit
with an error code immediately.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Since LLVM r244854 there is no BumpPtrStringSaver, but StringSaver can
be constructed with a BumpPtrAllocator.
|
| |
|
|
| |
The gccxml output format had this attribute.
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
Resolve conflicts in files that we previously removed from our side by
removing them again.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
We do not need any of the settings from the latter.
|
| |
|
|
| |
Use llvm::sys instead.
|
| |
|
|
| |
Use std::getline instead.
|
| |
|
|
| |
Use llvm::sys instead.
|
| |
|
|
| |
Use llvm::sys::fs::exists instead.
|
| |
|
|
| |
Use llvm::StringRef::split instead.
|
| |
|
|
| |
Use std::getenv instead.
|
| |
|
|
|
| |
We do not need the full conversion performed by ConvertToUnixSlashes.
Simply use std::replace to convert backslashes to forward slashes.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
Add a PrintAttributesAttribute helper and use it anywhere we currently
print the attributes="" attribute.
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Use `auto` to adapt to the Compilation::getJobs() return type.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
Save the CXXRecordDecl downcast in a local variable so we can use
it multiple times.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Store our printing policy in a member up front.
|