summaryrefslogtreecommitdiffstats
path: root/clang/tools
Commit message (Collapse)AuthorAgeFilesLines
...
* clang-format: Fix clang-format-diff.py according to diff specification.Daniel Jasper2013-10-021-2/+5
| | | | | | | | | | | | | | | | | | | | | Patch by Alp Toker. Many thanks! Original descriptions: clang-format-diff incorrectly modifies unchanged lines due to an error in diff parsing. The unified diff format has a default line change count of 1, and 0 may be specified to indicate that no lines have been added. This patch updates the parser to accurately reflect the diff specification. This also has the benefit of stabilising the operation so it will produce the same output when run multiple times on the same changeset, which was previously not the case. No tests added because this script is not currently tested (though we should look into that!) llvm-svn: 191820
* [OpenMP] Added parsing and semantic analysis for firstprivate clauseAlexey Bataev2013-10-012-0/+11
| | | | llvm-svn: 191730
* Remove unused variable introduced in 191666David Blaikie2013-09-301-3/+0
| | | | llvm-svn: 191682
* Moving style option formatting to libFormatEdwin Vane2013-09-301-78/+6
| | | | | | | | | The help text for clang-format's -style option and the function that processes its value is moved to libFormat in this patch. The goal is to enable other tools that use libFormat and also have a -style option to behave consistently with clang-format. llvm-svn: 191666
* Fix up fallout from r187156.Bob Wilson2013-09-261-1/+1
| | | | | | | | | The previous change caused the driver to translate -Wa,-L to the -msave-temp-labels option for cc1as, but cc1as did not accept that option. This patch follows the same approach used for similar options (-relax-all, -noexecstack) in the previous patch. llvm-svn: 191458
* [libclang] Provide location for attributes and expose 'packed' attribute.Argyrios Kyrtzidis2013-09-252-0/+13
| | | | | | Patch by Loïc Jaquemet! llvm-svn: 191345
* [OPENMP] Bug fixes and improvements.Alexey Bataev2013-09-242-15/+25
| | | | | | | | 1. Fixed constructor of shared clause. 2. Some macros for clauses processing are replaced by private template methods. 3. Additional checks in sema analysis of OpenMP clauses. llvm-svn: 191265
* Fix array_pod_sort predicates after LLVM change.Benjamin Kramer2013-09-221-12/+3
| | | | llvm-svn: 191176
* Fix clang-format-diff.py to accept -style again.Daniel Jasper2013-09-211-1/+1
| | | | | | Copy and paste error in r190935.. llvm-svn: 191137
* Simplify clang-format-diff.py using new clang-format options.Daniel Jasper2013-09-181-59/+26
| | | | | | clang-format's -lines parameter makes this significantly easier. llvm-svn: 190935
* Add the intrinsic __builtin_convertvectorHal Finkel2013-09-182-0/+2
| | | | | | | | | | | | | | | | | | LLVM supports applying conversion instructions to vectors of the same number of elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to cause such instructions to be generated when using builtin vector types. C-style casting on vectors is already defined in terms of bitcasts, and so cannot be used for these conversions as well (without leading to a very confusing set of semantics). As a result, this adds a __builtin_convertvector intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is intended to aid the creation of vector intrinsic headers that create generic IR instead of target-dependent intrinsics (in other words, this is a generic _mm_cvtepi32_ps). As noted in the documentation, the action of __builtin_convertvector is defined in terms of the action of a C-style cast on each vector element. llvm-svn: 190915
* [libclang] Don't report a DecayedType as "unexposed", report it as the ↵Argyrios Kyrtzidis2013-09-161-0/+5
| | | | | | | | original (as written) type. Patch by Anders Waldenborg! llvm-svn: 190796
* [analyzer] scan-build: add missing semicolonJordan Rose2013-09-161-1/+1
| | | | | | Patch by Kevin Zheng! llvm-svn: 190789
* [analyzer] Put more uniqueness in scan-build's temporary directory names.Jordan Rose2013-09-141-3/+11
| | | | | | | | | | | | | | | This is necessary when running two scan-build processes in parallel. The directory naming scheme is now: yyyy-MM-dd-HHmmss-PID-N 2013-09-13-174210-123-1 where "PID" is the scan-build process ID, and "N" is a sequential counter (not likely to be needed now that seconds are mangled in, but just in case). PR17196, using a suggested fix from Greg Czajkowski! llvm-svn: 190735
* Remove unnecessary inclusion of Sema.hDavid Blaikie2013-09-135-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let me tell you a tale... Within some twisted maze of debug info I've ended up implementing an insane man's Include What You Use device. When the debugger emits debug info it really shouldn't, I find out why & then realize the code could be improved too. In this instance CIndexDiagnostics.cpp had a lot more debug info with Clang than GCC. Upon inspection a major culprit was all the debug info describing clang::Sema. This was emitted because clang::Sema is befriended by DiagnosticEngine which was rightly required, but GCC doesn't emit debug info for friends so it never emitted anything for Clang. Clang does emit debug info for friends (will be fixed/changed to reduce debug info size). But why didn't Clang just emit a declaration of Sema if this entire TU didn't require a definition? 1) Diagnostic.h did the right thing, only using a declaration of Sema and not including Sema.h at all. 2) Some other dependency of CIndexDiagnostics.cpp didn't do the right thing. ASTUnit.h, only needing a declaration, still included Sema.h (hence this commit which removes that include and adds the necessary includes to the cpp files that were relying on this) 3) -flimit-debug-info didn't save us because of EnterExpressionEvaluationContext, defined inline in Sema.h which fires the "requiresCompleteType" check/flag (since it uses nested types from Sema and calls Sema member functions) and thus, if debug info is ever emitted for the type, the whole type is emitted and not just a declaration. Improving -flimit-debug-info to account for this would be... hard. Modifying the code so that's not 'required to be complete' might be possible, but probably only by moving EnterExpressionEvaluationContext either into Sema, or out of Sema.h. That might be a bit too much of a contortion to be bothered with. Also, this is only one of the cases where emitting debug info for friends caused us to emit a lot more debug info (this change reduces Clang's DWO size by 0.93%, dropping friends entirely reduces debug info by 3.2%) - I haven't hunted down the other cases, but I assume they might be similar (Sema or something like it). IWYU or a similar tool might help us reduce build times a bit, but analyzing debug info to find these differences isn't worthwhile. I'll take the 3.2% win, provide this small improvement to the code itself, and move on. llvm-svn: 190715
* clang-format: Add -assume-filename option for editor integrations.Daniel Jasper2013-09-134-15/+30
| | | | | | | | | | | | | | With -style=file, clang-format now starts to search for a .clang-format file starting at the file given with -assume-filename if it reads from stdin. Otherwise, it would start searching from the current directory, which is not helpful for editor integrations. Also changed vim, emacs and sublime integrations to actually make use of this flag. This fixes llvm.org/PR17072. llvm-svn: 190691
* Fix the MCTargetAsmParser API change.Joey Gouly2013-09-121-1/+1
| | | | llvm-svn: 190601
* [libclang] In clang_getLocation, check that the provided line/column is valid.Argyrios Kyrtzidis2013-09-121-0/+2
| | | | | | rdar://14971432 llvm-svn: 190568
* Fix 2 cases of uninitialized reads of an invalid PresumedLoc.Evgeniy Stepanov2013-09-111-13/+15
| | | | | | | | | The code in CGExpr was added back in 2012 (r165536) but not exercised in tests until recently. Detected on the MemorySanitizer bootstrap bot. llvm-svn: 190521
* Allow _clang-format as alternative to .clang-format config filenameHans Wennborg2013-09-104-5/+18
| | | | | | | | | | | Dotfiles are impractical on Windows. This makes clang-format search for the style configuration file as '_clang-format' in addition to the usual '.clang-format'. This is similar to how VIM searches for '_vimrc' on Windows. Differential Revision: http://llvm-reviews.chandlerc.com/D1629 llvm-svn: 190413
* Update to the new API interface which requires the MCRegisterInfo object. ↵Bill Wendling2013-09-091-2/+3
| | | | | | <rdar://problem/13623355> llvm-svn: 190291
* OpenMP: Data-sharing attributes analysis and clause 'shared' (fixed test ↵Alexey Bataev2013-09-062-0/+9
| | | | | | threadprivate_messages.cpp) llvm-svn: 190183
* Make error text if clang-format is not on the system PATH more helpful,Manuel Klimek2013-09-051-1/+10
| | | | | | | as this is going to be a common mistake (installing LLVM defaults to not putting the tools onto the PATH). llvm-svn: 190036
* Adds a VSPackage project that builds a VS extension to run clang-format over ↵Manuel Klimek2013-09-0415-0/+959
| | | | | | a selection / the line at the cursor. llvm-svn: 189955
* clang-cl: Use "clang cl.exe" when disambiguating the diagnostic prefix.Reid Kleckner2013-09-041-2/+2
| | | | llvm-svn: 189909
* clang-cl: Avoid confusing diagnostics when clang-cl is called just cl.exeReid Kleckner2013-09-041-1/+8
| | | | llvm-svn: 189901
* Remove unused typedef.Eric Christopher2013-09-031-1/+0
| | | | llvm-svn: 189844
* Revert "OpenMP: Data-sharing attributes analysis and clause 'shared'"Rafael Espindola2013-09-032-9/+0
| | | | | | | | This reverts commit r189795. threadprivate_messages.cpp is faling on windows. llvm-svn: 189811
* OpenMP: Data-sharing attributes analysis and clause 'shared'Alexey Bataev2013-09-032-0/+9
| | | | llvm-svn: 189795
* Added WebKit style to the BasedOnStyle handling and to the relevant help ↵Alexander Kornienko2013-09-022-4/+6
| | | | | | messages. llvm-svn: 189765
* Whitespace changes in help messages + updated help output in .rst file.Alexander Kornienko2013-09-021-4/+4
| | | | llvm-svn: 189762
* Switch the default mode for clang-format to '-file'. Make 'LLVM' theChandler Carruth2013-09-024-14/+16
| | | | | | | | | | | | | | | | | | | fallback syntax used when we fail to find a '.clang-format' file. Adjust variable names appropriately. Update the editor integration pieces that specify a '-style' option to specify it as '-style=file'. I left the functionality in place because even if the preferred method is to use '.clang-format' files, this way if someone needs to clobber the style in their editor we show how to do so in these examples. Also check in a '.clang-format' file for Clang to ensure that separate checkouts and builds of Clang from LLVM can still get the nice formatting. =] This unfortunately required nuking the test for the absence of a '.clang-format' file as now the directory happening to be under your clang source tree will cause there to always be a file. ;] llvm-svn: 189741
* Add ms_abi and sysv_abi attribute handling.Charles Davis2013-08-301-0/+2
| | | | | | Based on a patch by Benno Rice! llvm-svn: 189644
* Move individual group name strings from the OptionTable into one big char ↵Craig Topper2013-08-293-9/+9
| | | | | | array. Then only store offsets into it in the OptionTable. Saves about 4K from the clang binary and removes 400 relocation entries from DiagnosticIDs.o. llvm-svn: 189568
* Reorder and shrink size of NameLen field in diagnostic group table. Shaves ↵Craig Topper2013-08-282-5/+7
| | | | | | ~4K from clang binary. llvm-svn: 189445
* Merge diagnostic group tables to reduce data size and relocation entries.Craig Topper2013-08-282-15/+23
| | | | | | | | The individual group and subgroups tables are now two large tables. The option table stores an index into these two tables instead of pointers. This reduces the size of the options tabe since it doesn't need to store pointers. It also reduces the number of relocations needed. My build shows this reducing DiagnosticsIDs.o and the clang binary by ~20.5K. It also removes ~400 relocation entries from DiagnosticIDs.o. llvm-svn: 189438
* cmake: install a cl.exe binary in the tools/msbuild-bin dirHans Wennborg2013-08-281-0/+9
| | | | llvm-svn: 189435
* Delete CC_Default and use the target default CC everywhereReid Kleckner2013-08-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Makes functions with implicit calling convention compatible with function types with a matching explicit calling convention. This fixes things like calls to qsort(), which has an explicit __cdecl attribute on the comparator in Windows headers. Clang will now infer the calling convention from the declarator. There are two cases when the CC must be adjusted during redeclaration: 1. When defining a non-inline static method. 2. When redeclaring a function with an implicit or mismatched convention. Fixes PR13457, and allows clang to compile CommandLine.cpp for the Microsoft C++ ABI. Excellent test cases provided by Alexander Zinenko! Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1231 llvm-svn: 189412
* CMake: Fix standalone Clang build, take two.Jordan Rose2013-08-271-3/+3
| | | | | | | This time, use a variable that's defined consistently in standalone and non-standalone builds. llvm-svn: 189406
* Revert "CMake: Fix out-of-source build's symlinks."Reid Kleckner2013-08-271-3/+3
| | | | | | This reverts commit r189371, it broke the in-source cmake build. llvm-svn: 189390
* scan-build: Set CC and CXX as make variables when wrapping make builds.Jordan Rose2013-08-271-4/+4
| | | | | | | | | Variables set in a makefile are not overridden by environment variables. Make sure we actually override CC and CXX when using scan-build. Patch by Steve McCoy! llvm-svn: 189372
* CMake: Fix out-of-source build's symlinks.Jordan Rose2013-08-271-3/+3
| | | | | | Symlinks to clang should go in Clang's build directory, not LLVM's. llvm-svn: 189371
* Use pop_back_val() instead of both back() and pop_back().Robert Wilhelm2013-08-231-2/+1
| | | | | | No functionality change intended. llvm-svn: 189112
* Re-add clang-check to the Makefile build.Jordan Rose2013-08-221-0/+4
| | | | | | I was bound to screw this up somehow. llvm-svn: 189029
* Fix dependencies now that the ARC migrator depends on the static analyzer.Jordan Rose2013-08-222-9/+19
| | | | | | | | | | Thanks for pointing this out, Stephen. I think this is right now -- I attempted to try all four valid combinations with both the autoconf and CMake builds. See also LLVM changes to the configure script. llvm-svn: 189027
* Split isFromMainFile into two functions.Eli Friedman2013-08-221-1/+1
| | | | | | | | | Basically, isInMainFile considers line markers, and isWrittenInMainFile doesn't. Distinguishing between the two is useful when dealing with files which are preprocessed files or rewritten with -frewrite-includes (so we don't, for example, print useless warnings). llvm-svn: 188968
* Remove more uses of 'index' as namespace scope.Argyrios Kyrtzidis2013-08-211-6/+6
| | | | | | Follow up to r188850. llvm-svn: 188854
* Avoid using the 'index' namespace as scope.Argyrios Kyrtzidis2013-08-211-8/+9
| | | | | | This should fix the bogus ambiguous reference errors reported by gcc 4.2.1 that the FreeBSD bot is using. llvm-svn: 188850
* Fix iterator invalidation. PR16935.Eli Friedman2013-08-201-3/+4
| | | | llvm-svn: 188835
* Look at lowercase version of argv[0] when determining driver modeHans Wennborg2013-08-201-0/+2
| | | | llvm-svn: 188833
OpenPOWER on IntegriCloud