| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
The test added by commit 4ef8cb85 (test: Add case for
__builtin_assume_aligned declaration in MSVC header, 2020-04-03,
v0.3.3~2^2) uses the MSVC `__cdecl` calling convention specifier.
That is not supported by all target ABIs, so update the test to
run CastXML using the `x86_64-pc-windows-msvc` target triple.
Fixes: #165
|
|
|
|
| |
When `_MSC_VER` is among compiler predefines, the target ABI is MSVC.
|
|
|
|
|
|
|
|
|
| |
For Windows targets, GNU compilers predefine `_WIN32` and `__MINGW32__`.
CastXML uses those to set the target triple correctly when using
`--castxml-cc-gnu`. Teach our fake GNU compiler in the test suite to
define these too. Otherwise CastXML does not add `gnu` to the target
triple. This causes the Windows-hosted Clang to choose `msvc` in the
default triple and enable MS compatibility, which is incorrect.
|
|
|
|
|
|
| |
In commit f9a05da6 (RunClang: Tolerate __builtin_assume_aligned
declaration in MSVC header, 2020-03-31, v0.3.2~1^2) we left out a test
case. Add one now.
|
| |
|
|
|
|
|
| |
Extend the `--castxml-output=1` format to support decltype.
Create a dump node for the underlying type.
|
|
|
|
|
| |
Adapt our `target_link_libraries` call based on the version of LLVM
to account for policy `CMP0023` NEW behavior.
|
|
|
|
| |
The format of a lambda initializer changed slightly. Update our regex.
|
|
|
|
| |
Fixes: #94
|
|\
| |
| |
| |
| |
| | |
* ppc64:
Detect: Drop detected predefined macros conflicting with Clang's
Detect: Fix GNU builtin include directory detection on ppc64
|
| |
| |
| |
| |
| |
| | |
Extend the filtering added by commit 1cf66488 (Detect: Drop detected
predefined macros starting in '__has', 2015-02-04, v0.2.0~199) to cover
more Clang builtin macros. In particular, cover builtins on ppc64.
|
|/
|
|
|
| |
Some Debian builds have a "Debian" or "Ubuntu" string before
the clang version. Relax the test to allow for this.
|
|
|
|
|
|
|
|
| |
Provide `__castxml_{major,minor,patch}__`. Re-purpose `__castxml__` to
be for comparison with a `__castxml_check()` helper. Leave the actual
encoding of the components unspecified. Ensure the integer version
value of the encoding is larger than the only value of `1000` that
`__castxml__` had previously.
|
|
|
|
|
|
|
|
|
| |
Extend the `--castxml-output=1` format to support the nullptr type.
The name of the type is `decltype(nullptr)`. Recognize types named
exactly this way (as a literal) and treat them as a FundamentalType.
This gives the `std::nullptr_t` typedef a meaningful representation even
without full decltype support. Leave deeper nullptr-typed expressions
like `decltype((nullptr))` unchanged.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`. Use `clang-format` version 6.0.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
|
|
|
|
|
|
|
|
|
|
|
| |
This macro is missing from the main MSVC predefined macro list but is
documented by [1] and [2]. Also add `__STDCPP_STRICT_POINTER_SAFETY__`
as documented by [2] in case MSVC ever starts defining it.
[1] https://docs.microsoft.com/en-us/cpp/build/reference/zc-alignednew
[2] https://en.cppreference.com/w/cpp/preprocessor/replace
Fixes: #125
|
|
|
|
|
|
|
|
|
| |
Some types decay when used in function parameters (e.g. arrays become
pointers). When this occurs, add an `original_type` attribute to
reference the original type without decay.
Issue: #96
Inspired-by: Todd Martin (todoooo on github)
|
|
|
|
| |
Only the top-level decays.
|
|
|
|
|
|
|
|
|
|
|
| |
The builtin is used by the GNU type_traits header in modes aware of
C++17, so we need to provide it in CastXML. LLVM/Clang SVN r316518
(implement __has_unique_object_representations, 2017-10-24), in
development of Clang 6, added this GNU builtin. For older versions of
LLVM/Clang, provide a minimum implementation that at least allows
`type_traits` to parse.
Fixes: #98
|
| |
|
| |
|
|
|
|
|
|
|
| |
Updates to VS 2015 and VS 2017 added support for `-std:` flags
specifying the language standard level for MSVC. The level is reported
in the `_MSVC_LANG` preprocessor definition instead of `__cplusplus`.
Detect MSVC standard C++ level from `_MSVC_LANG`.
|
|
|
|
|
|
|
|
| |
LLVM/Clang somehow produces a different order of two implicit
constructors on Windows hosts than on other platforms. Update the
expected test results to accept either order.
Fixes: #95
|
|
|
|
| |
Fixes: #92
|
|
|
|
|
|
|
|
| |
Anonymous struct and union types may have constructors and destructors
that are also anonymous. Generate `name=""` in such cases because
clients expect these function-like elements to have names as gccxml did.
Issue: #89
|
| |
|
|
|
|
|
|
|
|
|
|
| |
In C++11 the compiler synthesizes class types to represent lambda
function objects. These types cannot be named directly, so treat them
as anonymous. Leave out all their members for now too because they
cannot be treated as normal C++98 classes represented by gccxml's
format.
Issue: #89
|
|
|
|
|
|
| |
When using `TEST_UPDATE` to convert the actual test output to the
expected test output we must convert `[` and `]` to `\[` and `\]`
to ensure it matches the actual content.
|
| |
|
|
|
|
|
|
|
|
| |
These were included by gccxml, and they make sense for a reference
type because its ABI is like a pointer type.
Suggested-by: todoooo@users.noreply.github.com
Issue: #89
|
|
|
|
|
|
|
| |
When an `auto` type is encountered in an interface, desugar it
through to the deduced type.
Issue: #89
|
|
|
|
|
|
|
| |
Treat `using Alias = Original` as `typedef Original Alias` to support
such constructs while still generating a gccxml-compatible format.
Issue: #89
|
|
|
|
|
|
|
| |
In the `Function-Argument-default-cast` case, spell out the special
members explicitly so that the resulting order does not depend on the
order that Clang adds them. The special methods are not the purpose of
this test case.
|
|
|
|
|
| |
LLVM/Clang 5.0 no longer mentions `/ObjC` or `/ObjC++`
in `not allowed with {C,C++}` error messages.
|
|
|
|
|
|
|
|
| |
Since Clang 3.9 a real `__float128` type is available for some targets.
Use it instead of our simulation struct. This is needed to work with
the GCC 7 standard library which uses `__float128` types in expressions.
Fixes: #87
|
|
|
|
| |
This was forgotten when the elaborated type specifier changes were made.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Elaborated type specifiers refer to a class, struct, union, or enum name
preceded by the corresponding keyword (e.g. `struct foo`). These type
specifiers are important for C code, but are also sometimes relevant in
the context of C++ code.
Add an `ElaboratedType` XML element to the castxml output format to
represent elaborated type specifiers. Increment the format *major*
version number to indicate the addition of an element that will require
clients to be updated.
|
|
|
|
|
|
| |
The GCC-XML output included these attributes, so CastXML should too.
Closes: #80
|
|
|
|
|
|
| |
The GCC-XML output included these attributes, so CastXML should too.
Closes: #80
|
|
|
|
|
|
| |
When using `TEST_UPDATE` to convert the actual test output to the
expected test output we must convert the `CastXML` element as we
already do for `GCC_XML`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run all `gccxml.*` test cases as `castxml1.*` test cases covering output
format with `--castxml-output=1`. Produce the expected test output
files as follows:
(cd test/expect && rename 's/^gccxml/castxml1/' gccxml.*) &&
git checkout test/expect &&
sed -i 's/GCC_XML/CastXML/' test/expect/castxml1.*
This covers the current behavior of having both formats identical except
for the root element. Later the new format outputs can be adapted as
the format is changed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This will allow us to move the format forward away from gccxml
compatibility in order to add information about new C++ structures.
The new format will work with all C and C++ language modes but
still not for Objective C/C++.
Retain the `--castxml-gccxml` flag to produce XML files as similar as
possible as the ones produced by gccxml, but do not allow both formats
to be specified at the same time. For now use the same output for both
formats except for the name of the root element. Later the new format
can be adapted to add new features.
|
|
|
|
|
| |
These test cover the output, but the test infrastructure does not care
which format.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Run the `src/clang-format.bash` script to update all our C and C++
code to a new style defined by `.clang-format`. Use `clang-format`
version 3.8. Fix expected test output for new line numbers.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
|
| |
|
|
|
|
|
|
|
| |
CastXML documents that the `--castxml-gccxml` output format excludes
non-c++98 constructs.
Closes: #76
|
|
|
|
|
|
|
|
|
|
| |
All C++98 function declarations have identifiers as names. Some C++11
function declarations, such as user defined literal operators, do not
have identifiers. While we may implement support for these in a future
non-gccxml output format, for now simply avoid an assertion failure by
outputting such declarations as Unimplemented nodes.
Issue: #76
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the code
template <typename> struct A {
struct B {
typedef int intermediate_type;
typedef intermediate_type type;
};
};
Clang represents `A<int>::B::type` as a typedef whose type is sugared to
`A<>::B::intermediate_type` where `A<>::B` is a non-template whose
context is an uninstantiated template `A<>` even though the original
typedef's context `A<int>::B` is a non-template whose context is an
instaniated template `A<int>`.
Since CastXML's gccxml output format does not support uninstantiated
templates we cannot represent the context of `intermediate_type` so we
must desugar it instead. Otherwise we end up with an `Unimplemented`
node or even a crash in Clang because we perform operations meant for
non-templates on the template context. We previously did this for
typedefs that appear directly in template contexts, but not for those
whose contexts are nominally non-template but contained in a template
context. Fix the logic to loop through all nested contexts to perform
this check.
Closes: #70
|
|
|
|
|
|
|
|
|
|
| |
Refactoring in commit 917c646e (Output: Generalize exclusion of internal
`__castxml` builtins, 2016-04-18) introduced an unconditional call to
`clang::NamedDecl::getName`, but that method asserts that the name is
a valid identifier. Instead call `getIdentifier` ourselves and check
the name only if it is a valid identifier.
GitHub-Issue: #62
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The approach used in commit 1414278259 (castxml: Fix `__float128`
simulation with `-std=gnu++{11,14}`, 2016-01-25) allowed Clang to use
its own builtin `__float128` type when it is available. However, Clang
does not really implement this builtin and issues diagnostics when it is
used in some contexts (e.g. as a data member).
Instead we need to provide our own approximation of the builtin in all
cases. Avoid a conflict with the Clang builtin by using the
preprocessor to rename the type to `__castxml__float128`. Then replace
this name with `__float128` during output.
GitHub-Issue: CastXML/CastXML#59
|