- Sep 05, 2017
-
-
Sylvestre Ledru authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312535 91177308-0d34-0410-b5e6-96231b3b80d8
-
Raphael Isemann authored
Summary: Currently clang segfaults when invoked with `clang --autocomplete=`. This patch adds the necessary boundary checks and some tests for corner cases like this. Reviewers: yamaguchi Reviewed By: yamaguchi Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37465 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312533 91177308-0d34-0410-b5e6-96231b3b80d8
-
Simon Pilgrim authored
The for loop already checks that Idx < NumOfArgs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312525 91177308-0d34-0410-b5e6-96231b3b80d8
-
Andrey Kasaurov authored
In current OpenCL implementation some options are set in OpenCL RT/Driver, which causes discrepancy between online and offline paths. Implement infrastructure to move options from OpenCL RT/Driver to AMDGPUToolChain using overloaded TranslateArgs() method. Create map for default options values, as Options.td doesn't support default values (in contrast with OPTIONS.def). Add two driver options: -On and -mNN (like -O3, -m64). Some minor formatting changes to follow the clang-format style. Differential Revision: https://reviews.llvm.org/D37386 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312524 91177308-0d34-0410-b5e6-96231b3b80d8
-
Simon Pilgrim authored
Based off the Intel Intrinsics guide, we should expect a void const* argument. Prevents 'passing 'const void *' to parameter of type 'void *' discards qualifiers' warnings. Differential Revision: https://reviews.llvm.org/D37449 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312523 91177308-0d34-0410-b5e6-96231b3b80d8
-
Mehdi Amini authored
By exposing the constant initializer, the optimizer can fold many of these constructs. This is a recommit of r311857 that was reverted in r311898 because an assert was hit when building Chromium. We have to take into account that the GlobalVariable may be first created with a different type than the initializer. This can happen for example when the variable is a struct with tail padding while the initializer does not have padding. In such case, the variable needs to be destroyed an replaced with a new one with the type of the initializer. Differential Revision: https://reviews.llvm.org/D34992 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312512 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
Sometimes we create the ASTContext and thus the TranslationUnitDecl before we know the LangOptions. This should fix the asan buildbot failures after r312467. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312506 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 04, 2017
-
-
Daniel Jasper authored
Before: #ifndef A_H #define A_H #define A() \ int i; \ int j; #endif // A_H After: #ifndef A_H #define A_H #define A() \ int i; \ int j; #endif // A_H git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312484 91177308-0d34-0410-b5e6-96231b3b80d8
-
Simon Pilgrim authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312479 91177308-0d34-0410-b5e6-96231b3b80d8
-
Raphael Isemann authored
Summary: So far we used a value of 10 which was useful for testing but produces many false-positives in real programs. The usual suspicious clones we find seem to be at around a complexity value of 70 and for normal clone-reporting everything above 50 seems to be a valid normal clone for users, so let's just go with 50 for now and set this as the new default value. This patch also explicitly sets the complexity value for the regression tests as they serve more of a regression testing/debugging purpose and shouldn't really be reported by default in real programs. I'll add more tests that reflect actual found bugs that then need to pass with the default setting in the future. Reviewers: NoQ Subscribers: cfe-commits, javed.absar, xazax.hun, v.g.vassilev Differential Revision: https://reviews.llvm.org/D34178 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312468 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
This follows the scheme agreed with Nathan Sidwell, which can be found here: https://gcc.gnu.org/wiki/cxx-modules?action=AttachFile This will be proposed to the itanium-cxx-abi list once we have some experience with how well it works; the ABI for this TS should be considered unstable until it is part of the Itanium C++ ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312467 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 03, 2017
-
-
Hal Finkel authored
Because it is common to treat vector types as an array of their elements, or even some other type that's not the element type, and thus index into them, we can't use struct-path TBAA for these accesses. Even though we already treat all vector types as equivalent to 'char', we were using field-offset information for them with TBAA, and this renders undefined the intra-value indexing we intend to allow. Note that, although 'char' is universally aliasing, with path TBAA, we can still differentiate between access to s.a and s.b in struct { char a, b; } s;. We can't use this capability as-is for vector types. Fixes PR33967. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312447 91177308-0d34-0410-b5e6-96231b3b80d8
-
Jatin Bhateja authored
Differential Revision: https://reviews.llvm.org/D37426 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312444 91177308-0d34-0410-b5e6-96231b3b80d8
-
Yaxun Liu authored
Not all targets support vararg (e.g. amdgpu). Instead of using vararg in the emitted functions for enqueue_kernel, this patch creates a temporary array of size_t, stores the size arguments in the temporary array and passes it to the emitted functions for enqueue_kernel. Differential Revision: https://reviews.llvm.org/D36678 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312441 91177308-0d34-0410-b5e6-96231b3b80d8
-
Raphael Isemann authored
Summary: This patch contains performance improvements for the `MinComplexityConstraint`. It reduces the constraint time when running on the SQLite codebase by around 43% (from 0.085s down to 0.049s). The patch is essentially doing two things: * It introduces a possibility for the complexity value to early exit when reaching the limit we were checking for. This means that once we noticed that the current clone is larger than the limit the user has set, we instantly exit and no longer traverse the tree or do further expensive lookups in the macro stack. * It also removes half of the macro stack lookups we do so far. Previously we always checked the start and the end location of a Stmt for macros, which was only a middle way between checking all locations of the Stmt and just checking one location. In practice I rarely found cases where it really matters if we check start/end or just the start of a statement as code with lots of macros that somehow just produce half a statement are very rare. Reviewers: NoQ Subscribers: cfe-commits, xazax.hun, v.g.vassilev Differential Revision: https://reviews.llvm.org/D34361 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312440 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
This fixes llvm.org/PR34366. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312437 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Extract the target specific option application. This is a huge switch which was inlined into the `ConstructJob` option which adds a large amount of code to the already large function. Extract it to simply reduce the line count. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312436 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Out-of-line the logic for selecting the debug information handling. This is still split across the new function and partially inline in the job construction. This is needed since the split portion attempts to record the "-cc1" arguments. This needs to be the very last item to ensure that all the flags are recorded. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312435 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Move the `-mfpmath` handling with the rest of the floating point optimization flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312434 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 02, 2017
-
-
Vitaly Buka authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312407 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Extract the handling of the `-fbuiltin` family of flags to the driver. This centralises the handling of those options, keeping the long standing `#if 0`'ed block of code. This requires some additional code archaeology to determine if we need to enable this functionality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312392 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Extract the logic for the floating point handling into its own function. None of this information is needed for calculating the remainder of the arguments to the frontend. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312385 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 01, 2017
-
-
Evgeniy Stepanov authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312361 91177308-0d34-0410-b5e6-96231b3b80d8
-
Erich Keane authored
"target" implementation A small set of refactors that'll make it easier for me to implement 'target' support. First, extract the CPUSupports functionality into its own function. THis has the advantage of not wasting time in this builtin to deal with arguments. Second, pulls both CPUSupports and CPUIs implementation into a member-function, so that it can be called from the resolver generation that I'm working on. Third, creates an overload that takes simply the feature/cpu name (rather than extracting it from a callexpr), since that info isn't available later. Note that despite how the 'diff' looks, the EmitX86CPUSupports function simply takes the implementation out of the 'switch'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312355 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Extract a function to render the diagnostics options to the clang frontend. This continues the simplification of the clang cc1 command line invocation generation. NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312351 91177308-0d34-0410-b5e6-96231b3b80d8
-
Kostya Serebryany authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312346 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Extract the ObjC option rendering for the frontend. This localises the option translation. It augments the existing `AddRuntimeObjCOptions` which handles the runtime/ABI versioning flags only. This new function handles the non-runtime selecting flags. This logic was previously inlined into the `ConstructJob` function. Minor change to the flag ordering to group the blocks related flags together. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312344 91177308-0d34-0410-b5e6-96231b3b80d8
-
Benjamin Kramer authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312336 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Extract a function to render the options related to modules. This reduces the cyclomatic complexity of the `ConstructJob` function. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312330 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alex Lorenz authored
rule classes This commit changes the way that the refactoring results are produced. Instead of using different `RefactoringActionRule` subclasses for each result type, Clang now use a single `RefactoringResultConsumer`. This was suggested by Manuel in https://reviews.llvm.org/D36075. Differential Revision: https://reviews.llvm.org/D37291 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312316 91177308-0d34-0410-b5e6-96231b3b80d8
-
Martin Storsjo authored
This fixes cases where dynamic classes produced RTTI data with external linkage, producing linker errors about duplicate symbols. This touches code close to what was changed in SVN r244266, but this change doesn't break the tests added in that revision. The previous version had missed to update CodeGenCXX/virt-dtor-key.cpp, which had a behaviour change only when running the testsuite on windows. Differential revision: https://reviews.llvm.org/D37327 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312306 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Bataev authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312296 91177308-0d34-0410-b5e6-96231b3b80d8
-
Alexey Bataev authored
step>1. If the loop is a loot with random access iterators and the iteration construct is represented it += n, then the compiler crashed because of reusing of the same MaterializedTemporaryExpr around N. Patch fixes it by using the expression as written, without any special kind of wrappings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312292 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Aug 31, 2017
-
-
Dave Lee authored
Summary: This allows `linkageSpecDecl` to be used from `clang-query`. See also D31869 which similary adds `isStaticStorageClass`. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D37346 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312283 91177308-0d34-0410-b5e6-96231b3b80d8
-
Erich Keane authored
Patch By: anatol.pomozov (anatol.pomozov@gmail.com) Differential Revision: https://reviews.llvm.org/D37312 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312281 91177308-0d34-0410-b5e6-96231b3b80d8
-
Oleg Ranevskyy authored
Summary: Currently object format is taken from the default target triple. For toolchains with a non-COFF default target this may result in an object format inappropriate for pc-windows and lead to compilation issues. For example, the default triple `aarch64-linux-elf` may produce something like `aarch64-pc-windows-msvc19.0.24215-elf` in CL mode. Clang creates `MicrosoftARM64TargetInfo` for such triple with data layout `e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128`. On the other hand, the AArch64 backend in `computeDataLayout` detects a non-COFF target and selects `e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128` as data layout for little endian. Different layouts used by clang and the backend cause an error: ``` error: backend data layout 'e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128' does not match expected target description 'e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128' ``` This can be observed on the clang's Driver/cl-pch.c test with AArch64 as a default target. This patch enforces COFF in CL mode. Reviewers: hans Reviewed By: hans Subscribers: cfe-commits, aemerson, asl, kristof.beyls Differential Revision: https://reviews.llvm.org/D37336 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312275 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
EXPENSIVE_CHECKS enables libstdc++'s library consistency checks, which includes checking the container passed to std::priority_queue for its well-formedness. This makes the clang-format memoization too expensive, so disable it. (it's a necessary feature of libstdc++'s consistency checks that it ruins the required scalability of C++ standard library features - so these workarounds are to be expected if a test ever tries to test scalability in some way, like this test does) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312268 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
Extract the ARC migration tool flag handling into its own function. This simplifies the flow of the clang frontend command line construction function. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312244 91177308-0d34-0410-b5e6-96231b3b80d8
-
Dmitry Vyukov authored
We are starting to use data flow tracing in kernel. The interface is not subject to change anymore. Reviewed in https://reviews.llvm.org/D37303 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312232 91177308-0d34-0410-b5e6-96231b3b80d8
-
Martin Storsjo authored
Breaks on buildbot: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/4548/steps/test-check-all/logs/stdio The test in CodeGenCXX/virt-dtor-key.cpp tests using %itanium_abi_triple; on non-windows platforms, this resolves to the current platform triple (where there was no behaviour change), while on windows, it resolves to a mingw triple (where the behaviour was intentionally changed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312229 91177308-0d34-0410-b5e6-96231b3b80d8
-