| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
When `_MSC_VER` is among compiler predefines, the target ABI is MSVC.
|
| |
|
|
|
|
|
|
| |
The `llvm::StringRef` type now requires explicit conversion to
`std::string`. Such explicit conversions still work with older
versions of LLVM/Clang too.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
There is no `emmintrin.h` header for this architecture, so use
`altivec.h` instead.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Modern editors provide plenty of ways to visually separate functions.
Drop the explicit comments that previously served this purpose.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
These macros are builtin to Clang so we should not try to use any such
definitions detected from the compiler.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
|
|
|
|
|
|
| |
Implement '--castxml-cc-msvc' option to detect preprocessor settings and
the target triplet from MSVC-like compilers. Run the compiler command
with '-c -FoNUL detect_vs.cpp' and capture stdout and stderr. Create
the 'detect_vs.cpp' source using '#pragma message("...")' to tell the
compiler to print detected preprocessor definitions. Treat the stdout
as the preprocessor predefines block and parse it to extract the target
architecture. Extract the header file search path from the 'INCLUDE'
environment variable.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement '--castxml-cc-gnu' option to detect preprocessor settings and
the target triplet from GNU-like compilers. Run the compiler command
with "-E -dM -v empty.cpp" and capture stdout and stderr. Treat the
stdout as the preprocessor predefines block and parse it to extract the
target architecture. Parse the stderr to extract the header file search
path.
Install the now-populated share/castxml resource directory to the
CastXML_INSTALL_DATA_DIR.
|
|
Add members to the Options struct to hold the preprocessor and target
settings detected from a given compiler command. Add an API to fill in
the members.
|