summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* When pretty-printing a C++11 literal operator, don't insert whitespace betweenRichard Smith2015-10-0813-46/+50
| | | | | | | the "" and the suffix; that breaks names such as 'operator""if'. For symmetry, also remove the space between the 'operator' and the '""'. llvm-svn: 249641
* Don't emit exceptional stackrestore cleanups around inalloca functionsReid Kleckner2015-10-084-34/+16
| | | | | | | | The backend restores the stack pointer after recovering from an exception. This is similar to r245879, but it doesn't try to use the normal cleanup mechanism, so hopefully it won't cause the same breakage. llvm-svn: 249640
* Make clang_Cursor_getMangling not mangle if the declaration isn't mangledEhsan Akhgari2015-10-083-1/+12
| | | | | | | | | | | | Right now clang_Cursor_getMangling will attempt to mangle any declaration, even if the declaration isn't mangled (extern C). This results in a partially mangled name which isn't useful for much. This patch makes clang_Cursor_getMangling return an empty string if the declaration isn't mangled. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 249639
* [WinEH] Don't use lifetime markers for MS catch parametersReid Kleckner2015-10-072-2/+18
| | | | | | | | | We don't have a good place to put them. Our previous spot was causing us to optimize loads from the exception object to undef, because it was after the catchpad instruction that models the write to the catch object. llvm-svn: 249616
* Fix a shared CMake build by linking with libclangBasic.Benjamin Kramer2015-10-071-0/+1
| | | | | | Patch by Jan Vesely! llvm-svn: 249608
* ASTMatchers: Keep AllCallbacks in a set instead of a vectorDaniel Jasper2015-10-072-7/+8
| | | | | | | | | | | AllCallbacks is currently only used to call onStartOfTranslationUnit and onEndOfTranslationUnit on them. In this (and any other scenario I can come up with), it is important (or at least better) not to have duplicates in this container. E.g. currently onEndOfTranslationUnit is called repeatedly on the same callback for every matcher that is registered with it. llvm-svn: 249598
* clang-format: Add include sorting capabilities to sublime, emacs andDaniel Jasper2015-10-073-1/+6
| | | | | | clang-format-diff.py. llvm-svn: 249567
* [VFS] Port driver tool chains to VFS.Benjamin Kramer2015-10-0711-147/+251
| | | | | | | There are still some loose ends here but it's sufficient so we can detect GCC headers that are inside of a VFS. llvm-svn: 249556
* clang-format: Fixed missing space between Obj-C for/in and a typecast.Daniel Jasper2015-10-072-1/+15
| | | | | | | | | | | | | | | | | Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504 TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro but not TT_ObjCForIn, so lines that look like: for (id nextObject in (NSArray *)myArray) would incorrectly turn into: for (id nextObject in(NSArray *)myArray) Patch by Kent Sutherland, thank you. llvm-svn: 249553
* [clang-format] Stop alignment sequences on open braces and parens whenDaniel Jasper2015-10-072-8/+58
| | | | | | | | | | | | | | | | | aligning assignments. This was done correctly when aligning the declarations, but not when aligning assignments. FIXME: The code between assignments and declarations alignment is roughly duplicated and would benefit from factorization. Bug 25090: https://llvm.org/bugs/show_bug.cgi?id=25090 Patch by Beren Minor. Thank you. llvm-svn: 249552
* clang-format: Hopefully fix code blocks in docs.Daniel Jasper2015-10-072-1/+7
| | | | | | Otherwise I will have to install sphinx ;).. llvm-svn: 249542
* Silence warning about not being able to find clang-interpreterRichard Barton2015-10-071-11/+15
| | | | | | This binary is only built with the examples project, so only require it then. llvm-svn: 249538
* Make the test take input from stdin to prevent matching characters in a file ↵Richard Barton2015-10-071-4/+4
| | | | | | path llvm-svn: 249535
* Fix crash in codegen on casting to `bool &`.Alexey Bataev2015-10-072-1/+10
| | | | | | | | Currently codegen crashes trying to emit casting to bool &. It happens because bool type is converted to i1 and later then lvalue for reference is converted to i1*. But when codegen tries to load this lvalue it crashes trying to load value from this i1*. Differential Revision: http://reviews.llvm.org/D13325 llvm-svn: 249534
* [VFS] Refactor VFSFromYAML a bit.Benjamin Kramer2015-10-071-60/+57
| | | | | | | | | | - Rename it to RedirectingFileSystem. This is what it does, YAML is just a serialization format for it. - Consistently use unique_ptr for memory management. No functional change intended. llvm-svn: 249532
* [VFS] Also drop '.' when adding files to an in-memory FS.Benjamin Kramer2015-10-072-0/+10
| | | | | | Otherwise we won't be able to find them later. llvm-svn: 249525
* Make clang-format actually respect custom brace wrapping flags.Daniel Jasper2015-10-072-2/+15
| | | | | | This fixes llvm.org/PR25073. llvm-svn: 249519
* clang-format: Fix false ObjC block detection.Daniel Jasper2015-10-072-0/+7
| | | | | | | | | | | Before: inline A operator^(const A &lhs, const A &rhs) {} int i; After: inline A operator^(const A &lhs, const A &rhs) {} int i; llvm-svn: 249517
* clang-format: Understand array reference types.Daniel Jasper2015-10-072-1/+2
| | | | | | | | | | | | Before: void f(Type(&parameter)[10]) {} void f(Type (*parameter)[10]) {} After: void f(Type (&parameter)[10]) {} void f(Type (*parameter)[10]) {} llvm-svn: 249502
* clang-format: Fix false positive in pointer/reference detection.Daniel Jasper2015-10-072-1/+4
| | | | | | | | | | Before: return options != nullptr &&operator==(*options); After: return options != nullptr && operator==(*options); llvm-svn: 249501
* clang/test/CodeGen/exceptions-seh-leave-new.c: Use "opt -instnamer" for ↵NAKAMURA Takumi2015-10-071-1/+1
| | | | | | branch-sensitive checks. llvm-svn: 249499
* [SEH] Fix x64 __exception_code in __except blocksReid Kleckner2015-10-072-8/+36
| | | | | | | Use llvm.eh.exceptioncode to get the code out of EAX for x64. For 32-bit, the filter is responsible for storing it to memory for us. llvm-svn: 249497
* Fix Clang-tidy modernize-use-nullptr warnings in source directories; other ↵Hans Wennborg2015-10-0619-168/+112
| | | | | | | | | | minor cleanups Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13406 llvm-svn: 249484
* Revert r249437Ehsan Akhgari2015-10-063-12/+1
| | | | llvm-svn: 249440
* Make clang_Cursor_getMangling don't mangle if the declaration isn't mangledEhsan Akhgari2015-10-063-1/+12
| | | | | | | | | | | | Right now clang_Cursor_getMangling will attempt to mangle any declaration, even if the declaration isn't mangled (extern "C"). This results in a partially mangled name which isn't useful for much. This patch makes clang_Cursor_getMangling return an empty string if the declaration isn't mangled. Patch by Michael Wu <mwu@mozilla.com>. llvm-svn: 249437
* [Tooling] Don't run a tool invocation without a FileManager.Benjamin Kramer2015-10-061-1/+3
| | | | | | Fixes a crash regression from r249410. llvm-svn: 249413
* [Tooling] Reuse FileManager in ASTUnit.Benjamin Kramer2015-10-063-18/+14
| | | | | | | | ASTUnit was creating multiple FileManagers and throwing them away. Reuse the one from Tooling. No functionality change now but necessary for VFSifying tooling. llvm-svn: 249410
* [VFS] Put the incoming name in the file status to make InMemoryFS behave ↵Benjamin Kramer2015-10-062-1/+14
| | | | | | more like a real FS. llvm-svn: 249409
* [Tooling] Remove dead code.Benjamin Kramer2015-10-061-9/+1
| | | | | | | | | | It took me some time to figure out why this is not working as expected: std:error_code converts to true if there is an error. This means we never ever took the generated absolute path, which happens to be the right thing anyways as it properly works with virtual files. Just remove the whole thing, relative paths are covered by existing tooling tests. llvm-svn: 249408
* ToolingTests: Tweak getAnyTarget() to match "x86_64".NAKAMURA Takumi2015-10-061-3/+5
| | | | | | Both "x86" and "x86-64" are incompatible to triple's arch. llvm-svn: 249403
* BasicTests: Suppress InMemoryFileSystemTest.WindowsPath on win32 while ↵NAKAMURA Takumi2015-10-061-0/+2
| | | | | | investigating. llvm-svn: 249395
* clang-format: Add empty line before code-blocks in Docs.Daniel Jasper2015-10-062-1/+7
| | | | llvm-svn: 249394
* clang-format: Make IncludeCategories configurable in .clang-format file.Daniel Jasper2015-10-065-32/+104
| | | | | | | | | This was made much easier by introducing an IncludeCategory struct to replace the previously used std::pair. Also, cleaned up documentation and added examples. llvm-svn: 249392
* Adds a way for tools to deduce the target config from a compiler name.Manuel Klimek2015-10-064-0/+130
| | | | | | | | | | | | | Adds `addTargetAndModeForProgramName`, a utility function that will add appropriate `-target foo` and `--driver-mode=g++` tokens to a command line for driver invocations of the form `a/b/foo-g++`. It is intended to support tooling: for example, should a compilation database record some invocation of `foo-g++` without these implicit flags, a Clang tool may use this function to add them back. Patch by Luke Zarko. llvm-svn: 249391
* [VFS] Port SimpleFormatContext to InMemoryFileSystem.Benjamin Kramer2015-10-061-6/+6
| | | | llvm-svn: 249389
* [VFS] Port applyAllReplacements to InMemoryFileSystem.Benjamin Kramer2015-10-061-8/+7
| | | | llvm-svn: 249388
* [VFS] Transition clang-format to use an in-memory FS.Benjamin Kramer2015-10-065-17/+54
| | | | | | | | | | | Apart from being cleaner this also means that clang-format no longer has access to the host file system. This isn't necessary because clang-format never reads includes :) Includes minor tweaks and bugfixes found in the VFS implementation while running clang-format tests. llvm-svn: 249385
* Remove duplicated default arguments. NFC.Benjamin Kramer2015-10-051-10/+8
| | | | llvm-svn: 249355
* Fix the MSVC build.Rafael Espindola2015-10-051-4/+4
| | | | | | No idea what asymmetry MSVC is findind. llvm-svn: 249346
* Revert r107690 (for PR7417) and add a testcase that it breaks. The approach ofRichard Smith2015-10-055-61/+18
| | | | | | | | | that change turns out to not be reasonable: mutating the AST of a parsed template during instantiation is not a sound thing to do, does not work across chained PCH / modules builds, and is in any case a special-case workaround to a more general problem that should be solved centrally. llvm-svn: 249342
* Adding an AST node matcher for NonTypeTemplateParmDecl objects.Aaron Ballman2015-10-053-1/+30
| | | | llvm-svn: 249341
* [sanitizer] Enable lsan for AArch64Adhemerval Zanella2015-10-051-1/+1
| | | | llvm-svn: 249338
* Re-introduce the unique_ptr removed in r249328 and just makeAdrian Prantl2015-10-052-5/+4
| | | | | | | | ~CodeGenABITypes out-of-line, which should have the same effect. Thanks to David Blaikie for pointing this out! llvm-svn: 249336
* Undo the unique_ptr'fication of CodeGenABITypes::CGM introduced in r248762.Adrian Prantl2015-10-052-1/+7
| | | | | | | | | | include/clang/CodeGenABITypes.h is in meant to be included by external users, but using a unique_ptr on the private CodeGenModule introduces a dependency on the type definition that prevents such a use. NFC llvm-svn: 249328
* Adding a narrowing AST matcher for FunctionDecl::isVariadic(), plus tests ↵Aaron Ballman2015-10-055-0/+41
| | | | | | and documentation. llvm-svn: 249321
* [VFS] Fix the windows build by including the right headers.Benjamin Kramer2015-10-051-0/+8
| | | | llvm-svn: 249319
* [VFS] Fix compilation on systems where time_t is not int64_t.Benjamin Kramer2015-10-051-4/+4
| | | | | | No functional change intended. llvm-svn: 249318
* [VFS] Add working directories to every virtual file system.Benjamin Kramer2015-10-053-8/+100
| | | | | | | | | | | | For RealFileSystem this is getcwd()/chdir(), the synthetic file systems can make up one for themselves. OverlayFileSystem now synchronizes the working directories when a new FS is added to the overlay or the overlay working directory is set. This allows purely artificial file systems that have zero ties to the underlying disks. Differential Revision: http://reviews.llvm.org/D13430 llvm-svn: 249316
* [VFS] Add an in-memory file system implementation.Benjamin Kramer2015-10-054-11/+352
| | | | | | | | | | This is a simple file system tree of memory buffers that can be filled by a client. In conjunction with an OverlayFS it can be used to make virtual files accessible right next to physical files. This can be used as a replacement for the virtual file handling in FileManager and which I intend to remove eventually. llvm-svn: 249315
* [VFS] Move class out of method so it looks less like Java.Benjamin Kramer2015-10-051-26/+28
| | | | | | No functionality change. llvm-svn: 249314
OpenPOWER on IntegriCloud