summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Use StringRef instead of MemoryBuffer&.Rafael Espindola2014-08-123-10/+11
| | | | | | | This code doesn't care where the data it is processing comes from, so a StringRef is probably the most natural interface. llvm-svn: 215448
* clang-format: Avoid bad line break.Daniel Jasper2014-08-121-2/+3
| | | | | | | | | | | | | Before: int aaaaaaaaaaaaaaaaaaaaaaaaaaaaa(const typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa); After: int aaaaaaaaaaaaaaaaaaaaaaaaaaaaa( const typename aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa); llvm-svn: 215442
* Correctly implement -include search logic.Manuel Klimek2014-08-125-65/+43
| | | | | | | | | | | | | | | According to the gcc docs, -include uses the current working directory for the lookup instead of the main source file. This patch gets rid of NormalizeIncludePath (which relied on an implementation detail of FileManager / FileEntry for the include path logic to work), and instead hands the correct lookup information down to LookupFile. This will allow us to change the FileEntry's behavior regarding its Name caching. llvm-svn: 215433
* Debuginfo: Correctly tag variadic ObjC methods with ↵Frederic Riss2014-08-121-0/+3
| | | | | | | | DW_TAG_unspecified_parameter. Fixes rdar://13690847 llvm-svn: 215423
* Reject virt-specifiers on friend declarations. Give anonymous bitfields aRichard Smith2014-08-122-5/+23
| | | | | | location so their diagnostics have somewhere to point. llvm-svn: 215416
* Reject varargs '...' in function prototype if there are more parameters afterRichard Smith2014-08-112-5/+50
| | | | | | | | | | | it. Diagnose with recovery if it appears after a function parameter that was obviously supposed to be a parameter pack. Otherwise, warn if it immediately follows a function parameter pack, because the user most likely didn't intend to write a parameter pack followed by a C-style varargs ellipsis. This warning can be syntactically disabled by using ", ..." instead of "...". llvm-svn: 215408
* Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dumpRichard Smith2014-08-114-10/+38
| | | | | | | | anyway. If -ast-dump *is* also provided, then dump the AST declarations as well as the lookup results. This is invaluable for cross-correlating the lookup information with the declarations actually found. llvm-svn: 215393
* Change MemoryBuffer* to MemoryBuffer& parameter to Lexer::ComputePreambleDavid Blaikie2014-08-113-14/+14
| | | | | | | | | | | | | (dropping const from the reference as MemoryBuffer is immutable already, so const is just redundant - and while I'd personally put const everywhere, that's not the LLVM Way (see llvm::Type for another example of an immutable type where "const" is omitted for brevity)) Changing the pointer argument to a reference parameter makes call sites identical between callers with unique_ptrs or raw pointers, minimizing the churn in a pending unique_ptr migrations. llvm-svn: 215391
* unique_ptr-ify FileSystemStatCache::setNextStatCacheDavid Blaikie2014-08-114-10/+13
| | | | | | | | | | And in the process, discover that FileManager::removeStatCache had a double-delete when removing an element from the middle of the list (at the beginning or the end of the list, there was no problem) and add a unit test to exercise the code path (which successfully crashed when run (with modifications to match the old API) without this patch applied) llvm-svn: 215388
* unique_ptr-ify the MemoryBuffer parameter of GlobalModuleIndexDavid Blaikie2014-08-111-5/+4
| | | | llvm-svn: 215376
* Add some FIXMEs.Richard Smith2014-08-112-0/+4
| | | | llvm-svn: 215375
* Sema: Properly perform lookup when acting on fields for desig initsDavid Majnemer2014-08-111-88/+35
| | | | | | | | | | | | | | | | | | | | Clang used a custom implementation of lookup when handling designated initializers. The custom code was not particularly optimized and relied on standard lookup for typo-correction anyway. This custom code has to go, it doesn't properly support MSVC-style anonymous structs embedded inside other records; replace it with the typo-correction path. This has the side effect of speeding up semantic handling of the fields for a designated initializer while simplifying the code at the same time. This fixes PR20573. Differential Revision: http://reviews.llvm.org/D4839 llvm-svn: 215372
* Revert r215365 - Coverage mapping: emit mapping for cxx constructors that ↵Alex Lorenz2014-08-111-6/+1
| | | | | | use microsoft's ABI llvm-svn: 215371
* ToolChains.cpp: Increase size of Lines vector in DetectDistroHans Wennborg2014-08-111-1/+1
| | | | | | In a Clang bootstrap, the size of this vector was always 11. llvm-svn: 215370
* Increase the size of two SmallVectors in ↵Hans Wennborg2014-08-111-2/+2
| | | | | | | | Generic_GCC::GCCInstallationDetector::init In a bootstrap build of Clang, the size was always greater than 12. llvm-svn: 215369
* GCC compatibility: Ignore -fexec-charset=UTF-8 argument. It is the default ↵Sylvestre Ledru2014-08-111-0/+8
| | | | | | | | | | | | | | | | | | in Clang. Reject other values. Summary: Just like with -finput-charset=UTF-8 in review http://reviews.llvm.org/D4347, I think we should just ignore it when UTF-8 is provided. Reviewers: rnk, rafael Reviewed By: rafael Subscribers: rafael, cfe-commits Differential Revision: http://reviews.llvm.org/D4841 llvm-svn: 215368
* Coverage mapping: emit mapping for cxx constructors that use microsoft's ABIAlex Lorenz2014-08-111-1/+6
| | | | llvm-svn: 215365
* Increase SmallVector<> size in DiagnosticsEngine::setSeverityForGroupHans Wennborg2014-08-111-3/+3
| | | | | | | | In a Clang bootstrap, this vector always held 129 elements. Also switch to a range-based for loop. llvm-svn: 215360
* Work around default parameter problem in the static analyzer.Manuel Klimek2014-08-111-4/+7
| | | | | | | | | | | | | | | | | In cases like: struct C { ~C(); } void f(C c = C()); void t() { f(); } We currently do not add the CXXBindTemporaryExpr for the temporary (the code mentions that as the default parameter expressions are owned by the declaration, we'd otherwise add the same expression multiple times), but we add the temporary destructor pointing to the CXXBindTemporaryExpr. We need to fix that before we can re-enable the assertion. llvm-svn: 215357
* Fixes bug 20587 - Add K&R break before braces styleRoman Kashitsyn2014-08-111-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: http://llvm.org/bugs/show_bug.cgi?id=20587 Added K&R style. It could be enabled by the following option: ``` BreakBeforeBraces: KernighanRitchie ``` This style is like `Attach`, but break *only* before function declarations. As I can see, no additional logic required to support this style, any style different from other styles automagically satisfies K&R. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D4837 llvm-svn: 215354
* Sema: Handle declspecs without declarators in records properly in C modeDavid Majnemer2014-08-111-16/+28
| | | | | | | | | | | | | | | | | | | | | We had two bugs: - We wouldn't properly warn when a struct/union/enum was mentioned inside of a record definition if no declarator was provided. We should have mentioned that this declaration declares nothing. - We didn't properly support Microsoft's extension where certain declspecs without declarators would act as anonymous structs/unions. * We completely ignored the case where such a declspec could be a union. * We didn't properly handle the case where a record was defined inside another record: struct X { int a; struct Y { int b; }; }; llvm-svn: 215347
* Revert r215331, "unique_ptrify CompilerInstance::OutputFile(s) and remove a ↵NAKAMURA Takumi2014-08-112-18/+16
| | | | | | | | | | | | | | | | | | | | | unique_ptr around a non-owning raw_ostream in CodeGenAction::CreateASTConsumer" It cannot be compiled on Visual Studio 2012. clang\include\clang/Frontend/CompilerInstance.h(153): error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>' with [ _Ty=llvm::raw_ostream ] D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\memory(1447) : see declaration of 'std::unique_ptr<_Ty>::unique_ptr' with [ _Ty=llvm::raw_ostream ] This diagnostic occurred in the compiler generated function 'clang::CompilerInstance::OutputFile::OutputFile(const clang::CompilerInstance::OutputFile &)' llvm-svn: 215346
* unique_ptrify CompilerInstance::OutputFile(s) and remove a unique_ptr around ↵David Blaikie2014-08-102-16/+18
| | | | | | a non-owning raw_ostream in CodeGenAction::CreateASTConsumer llvm-svn: 215331
* Follow up to r215323 - avoid llvm::make_unique in this particular case ↵David Blaikie2014-08-101-3/+3
| | | | | | that's causing GCC on some buildbots some confusion. llvm-svn: 215327
* Out-of-line CompilerInstance::takeSema to avoid a header dependence from ↵David Blaikie2014-08-101-1/+5
| | | | | | | | | CompilerInstance.h on Sema.h Hopefully this fixes the libstdc++ build on some of the buildbots after r215321. llvm-svn: 215325
* Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie2014-08-1018-207/+200
| | | | | | | | After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. llvm-svn: 215323
* unique_ptr-ify CompilerInstance::takeSemaDavid Blaikie2014-08-101-1/+1
| | | | llvm-svn: 215321
* std::unique_ptr-ify the result of ASTUnit::LoadFromASTFileDavid Blaikie2014-08-103-16/+11
| | | | llvm-svn: 215320
* unique_ptr-ify FrontendAction::takeCurrentASTUnitDavid Blaikie2014-08-101-6/+7
| | | | llvm-svn: 215319
* unique_ptr-ify FileSystemStatCache::takeNextStatCacheDavid Blaikie2014-08-101-1/+1
| | | | llvm-svn: 215318
* unique_ptr-ify ASTReaderListener in the ASTReaderDavid Blaikie2014-08-103-7/+6
| | | | llvm-svn: 215317
* Fix PR20444 -- wrong number of vftable slots created when return adjustment ↵Timur Iskhodzhanov2014-08-101-30/+28
| | | | | | | | thunks are needed Reviewed at http://reviews.llvm.org/D4822 llvm-svn: 215312
* [modules] When considering merging a newly-declared typedef into an importedRichard Smith2014-08-101-1/+38
| | | | | | | | | one, perform the import if the types match even if the imported declaration is hidden. Otherwise, NamedDecl::declarationReplaces will drop one of the name lookup entries, making the typedef effectively inaccessible from one of the modules that declared it. llvm-svn: 215306
* Use std::unique_ptr to handle transient ownership of UnwrappedLine in ↵David Blaikie2014-08-091-6/+5
| | | | | | ScopedLineState llvm-svn: 215294
* Use the correct fallback directory for EABIHF targets on NetBSD/arm.Joerg Sonnenberger2014-08-091-2/+4
| | | | | | From Matt Thomas. llvm-svn: 215292
* NetBSD/aarch64 has no libgcc or libstdc++. Drop arm64 tests.Joerg Sonnenberger2014-08-092-0/+2
| | | | llvm-svn: 215291
* Fix six tests are failing on Windows after r215241-r215243.Yaron Keren2014-08-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang :: Frontend/iframework.c Clang :: Frontend/system-header-prefix.c Clang :: Index/annotate-comments-objc.m Clang :: Index/annotate-module.m Clang :: Index/index-module.m Clang :: Index/index-pch-with-module.m Clang :: PCH/case-insensitive-include.c Suprisingly the normalize_separators() was no-op when LLVM_ON_WIN32. Its replacement native() does change path separators into \ as expected, breaking these tests. I had fixed the tests by #ifndef LLVM_ON_WIN32 on the native call, to match the previous behaviour. If this logic is not used on Windows host, it might be completely deleted as there should not be windows path seperators on Linux hosts. I can't test on Linux but if someone can run tests on Linux after commenting out the line llvm::sys::path::native(NormalizedPath); and the tests pass, the whole if (LangOpts.MSVCCompat) could be deleted. llvm-svn: 215290
* Fix PR20479 -- missing vftable slots in case of virtual inheritance vs ↵Timur Iskhodzhanov2014-08-091-2/+9
| | | | | | | | return adjusting thunks Reviewed at http://reviews.llvm.org/D4829 llvm-svn: 215285
* Refactor the module map file used for uniquing a module name out ofBen Langmuir2014-08-097-39/+63
| | | | | | | | | class Module. It's almost always going to be the same as getContainingModule() for top-level modules, so just add a map to cover the remaining cases. This lets us do less bookkeeping to keep the ModuleMap fields up to date. llvm-svn: 215268
* Add predefined macros to identify x86_64h architectures.Bob Wilson2014-08-081-0/+4
| | | | | | Patch by Jim Grosbach. llvm-svn: 215260
* Predefine IB_DESIGNABLE and IBInspectable macros. <rdar://problem/17441860>Bob Wilson2014-08-081-0/+2
| | | | | | | | | These macros are used as markers for Interface Builder and need to be defined to empty strings since they have no impact on the code. Patch by Ted Kremenek. llvm-svn: 215259
* Add a cc1 "dump-coverage-mapping" for testing coverage mapping.Alex Lorenz2014-08-085-5/+67
| | | | | | Differential Revision: http://reviews.llvm.org/D4799 llvm-svn: 215258
* Simplify ownership of ExplodedGraph in the CoreEngine by removing unique_ptr ↵David Blaikie2014-08-081-25/+25
| | | | | | | | | | | | indirection. Summary: I was going to fix the use of raw pointer ownership in "takeGraph" when I realized that function was unused and the whole ExplodedGraph could just be owned by value without the std::unique_ptr indirection at all. Reviewers: jordan_rose Differential Revision: http://reviews.llvm.org/D4833 llvm-svn: 215257
* Add -link-cxx-sanitizer driver flag.Alexey Samsonov2014-08-082-9/+10
| | | | | | | | | | | | | | | | | | | | | | Summary: This flag can be used to force linking of CXX-specific parts of sanitizer runtimes into the final executable. It gives more precise control than --driver-mode=g++ and comes handy when user links several object files with sanitized C++ code into an executable, but wants to provide libstdc++ himself, instead of relying on Clang dirver's behavior. Test Plan: clang regression test suite Reviewers: chandlerc, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4824 llvm-svn: 215252
* Extend tautological pointer compare and pointer to bool conversion warnings toRichard Trieu2014-08-081-1/+21
| | | | | | | | | | | | | | | macro arguments. Previously, these warnings skipped any code in a macro expansion. Preform an additional check and warn when the expression and context locations are both in the macro argument. The most obvious case not caught is passing a pointer directly to a macro, i.e 'assert(&array)' but 'assert(&array && "valid array")' is caught. This is because macro arguments are not typed and the conversion happens inside the macro. llvm-svn: 215251
* Objective-C [qoi]. Issue warning and fixit if property-dot syntaxFariborz Jahanian2014-08-081-0/+12
| | | | | | | use mis-cased property name (which is currently accepted silently due to the way property setters are named). rdar://17911746 llvm-svn: 215250
* Sure-up MemoryBuffer ownership in JSONCompilationDatabase's ctor.David Blaikie2014-08-081-2/+2
| | | | llvm-svn: 215246
* Change __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ for versions > 10.9.Bob Wilson2014-08-081-6/+17
| | | | | | | | The previous encoding only allowed a single digit for the minor version number. This changes it to use 2 digits for both the minor version and the revision number. llvm-svn: 215245
* Use llvm::sys::path::native instead of llvm::sys::fs::normalize_separators.Rafael Espindola2014-08-081-2/+2
| | | | | | | llvm::sys::path::native has a superset of the functionality and this was the only use of llvm::sys::fs::normalize_separators. llvm-svn: 215242
* Partially revert r215204 - [mips] Add -mabicalls/-mno-abicalls to the driverDaniel Sanders2014-08-081-3/+0
| | | | | | | | It wasn't actually a bug that -mabicalls/-mno-abicalls wasn't being passed to GAS. The only reason we pass it to the integrated assembler is because it shares the same framework with CodeGen. llvm-svn: 215236
OpenPOWER on IntegriCloud