summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [objcmt] Add a modernization option to infer and suggest designated ↵Argyrios Kyrtzidis2013-12-102-0/+61
| | | | | | | | initializers. rdar://15509284 llvm-svn: 196943
* [AST] In ObjCInterfaceDecl::isDesignatedInitializer(), use getMethod() ↵Argyrios Kyrtzidis2013-12-101-3/+1
| | | | | | | | instead of lookupMethod(). lookupMethod also goes through categories, which we don't need there. llvm-svn: 196942
* [analyzer] Misc. tidying in IdenticalExprChecker.Jordan Rose2013-12-101-18/+16
| | | | | | Some things I missed when this first went in. llvm-svn: 196938
* [analyzer] Extend IdenticalExprChecker to check ternary operator results.Jordan Rose2013-12-102-7/+47
| | | | | | | | | | Warn if both result expressions of a ternary operator (? :) are the same. Because only one of them will be executed, this warning will fire even if the expressions have side effects. Patch by Anders Rönnholm and Per Viberg! llvm-svn: 196937
* [AArch64] Refactor the redundant code in the EmitAArch64ScalarBuiltinExpr()Chad Rosier2013-12-101-206/+189
| | | | | | function. No functional change intended. llvm-svn: 196936
* Objective-C. Provide fixit's for objc_bride_relatedFariborz Jahanian2013-12-103-8/+27
| | | | | | | attributed CF to ObjC type conversions. // rdar://15499111 llvm-svn: 196935
* [AArch64] Refactor the Neon vector/scalar floating-point convert intrinsics soChad Rosier2013-12-101-12/+11
| | | | | | that they use float/double rather than the vector equivalents when appropriate. llvm-svn: 196931
* Remove IndentBlocks, which sneaked winto the previous commitAlexander Kornienko2013-12-101-2/+0
| | | | llvm-svn: 196929
* Early attempts to format in GNU style.Alexander Kornienko2013-12-101-36/+21
| | | | | | | | | | | | | | | | Summary: This still misses a few important features, so there's no mention of this style in the help message, but a few style rules are implemented. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2371 llvm-svn: 196928
* [AArch64] Refactor the Neon vector/scalar floating-point convert implementation.Chad Rosier2013-12-101-24/+24
| | | | | | Specifically, reuse the ARM intrinsics when possible. llvm-svn: 196927
* Allow predefined styles to define different options for different languages.Alexander Kornienko2013-12-101-57/+74
| | | | | | | | | | | | | | | | | | | | | | | Summary: Allow predefined styles to define different options for different languages so that one can run: clang-format -style=google file1.cpp file2.js or use a single .clang-format file with "BasedOnStyle: Google" for both c++ and JS files. Added Google style for JavaScript with "BreakBeforeTernaryOperators" set to false. Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2364 llvm-svn: 196909
* Trivial change: added 'using clang::format::FormatStyle;'Alexander Kornienko2013-12-101-68/+54
| | | | llvm-svn: 196903
* Support GNU style rule to put a space before opening parenthesis.Alexander Kornienko2013-12-102-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The rule from the GNU style states: "We find it easier to read a program when it has spaces before the open-parentheses and after the commas." http://www.gnu.org/prep/standards/standards.html#index-spaces-before-open_002dparen This patch makes clang-format adds an option to put spaces before almost all open parentheses, except the cases, where different behavior is dictated by the style rules or language syntax: * preprocessor: ** function-like macro definitions can't have a space between the macro name and the parenthesis; ** `#if defined(...)` can have a space, but it seems, that it's more frequently used without a space in GCC, for example; * never add spaces after unary operators; * adding spaces between two opening parentheses is controlled with the `SpacesInParentheses` option; * never add spaces between `[` and `(` (there's no option yet). Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D2326 llvm-svn: 196901
* Implement DR1460: fix handling of default initializers in unions; don't allowRichard Smith2013-12-107-54/+176
| | | | | | | | | more than one such initializer in a union, make mem-initializers override default initializers for other union members, handle anonymous unions with anonymous struct members better. Fix a couple of semi-related bugs exposed by the tests for same. llvm-svn: 196892
* [AArch64 NEON] Support poly128_t and implement relevant intrinsic.Kevin Qin2013-12-102-0/+34
| | | | llvm-svn: 196888
* Revert r196859, "Use llvm::sys::path::append to concatenate paths", to ↵NAKAMURA Takumi2013-12-101-2/+5
| | | | | | appease FileManager. llvm-svn: 196865
* [CMake] clang/lib: Prune redundant dependencies.NAKAMURA Takumi2013-12-1010-20/+0
| | | | llvm-svn: 196864
* [ms-abi] 64-bit fixes for r196549Warren Hunt2013-12-101-10/+17
| | | | | | | | In order to address latent bugs that were easier to expose in 64-bit mode, we move the application of __declspec(align) to before the layout of vbases rather than after. llvm-svn: 196861
* Use llvm::sys::path::append to concatenate pathsDmitri Gribenko2013-12-101-5/+2
| | | | llvm-svn: 196859
* Take into consideration calling convention when processing specializations.Rafael Espindola2013-12-102-10/+16
| | | | | | This fixes pr18141. llvm-svn: 196855
* Sema: Enforce C++11 pointer-to-member template arguments should rulesDavid Majnemer2013-12-101-3/+1
| | | | | | | | | | | | The standard is pretty clear on what it allows inside of template arguments for non-type template parameters of pointer-to-member. They must be of the form &qualified-id and cannot come from sources like constexpr VarDecls or things of that nature. This fixes PR18192. llvm-svn: 196852
* [AArch64] Refactor the NEON scalar reduce pairwise intrinsics so that they useChad Rosier2013-12-091-6/+17
| | | | | | float/double rather than the vector equivalents when appropriate. llvm-svn: 196836
* [AArch64] Refactor the NEON scalar reduce pairwise front-end codegen to removeChad Rosier2013-12-091-11/+11
| | | | | | unnecessary patterns in tablegen. llvm-svn: 196835
* [AArch64] Remove q and non-q intrinsic definitions from the NEON scalar reduceChad Rosier2013-12-091-20/+10
| | | | | | pairwise implementation, using an overloaded definition instead. llvm-svn: 196834
* Objective-C: Improve on various diagnostics related toFariborz Jahanian2013-12-091-69/+83
| | | | | | use of objc_bridge_related attribute. // rdar://15499111 llvm-svn: 196828
* [CMake] clangSema doesn't depend on LLVM CodeGen any more.NAKAMURA Takumi2013-12-091-4/+1
| | | | llvm-svn: 196803
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-0918-26/+114
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. llvm-svn: 196800
* [CMake] clangDriver: Move LLVM stuff in target_link_library to ↵NAKAMURA Takumi2013-12-091-2/+6
| | | | | | LLVM_LINK_COMPONENTS. llvm-svn: 196798
* Save another call to GetAddrOfFunction.Rafael Espindola2013-12-092-8/+10
| | | | | | | Thread an optional GV down to EmitGlobalFunctionDefinition so that it can avoid the lookup when we already know the corresponding llvm global value. llvm-svn: 196789
* When we decide to output a deferred decl, remember the llvm GlobalValue.Rafael Espindola2013-12-093-24/+37
| | | | | | | | | We can reuse it to avoid a DenseMap+StringMap lookup to find if it was already emitted or not. This fixes a 2010 TODO. llvm-svn: 196785
* Output destructors and constructors in a more natural order.Rafael Espindola2013-12-091-12/+12
| | | | | | | | | | | | | | | | With this patch we output the in the order C2 C1 D2 D1 D0 Which means that a destructor or constructor that call another is output after the callee. This is a bit easier to read IHMO and a tiny bit more efficient as we don't put a decl in DeferredDeclsToEmit. llvm-svn: 196784
* clang-format: Be more conservative about braced list column layout.Daniel Jasper2013-12-093-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically disable it for nested braced lists as it commonly can look really weird. Eventually, we'll want to become smarter and format some of the nested lists better. Before: SomeStruct my_struct_array = { { aaaaaa, aaaaaaaa, aaaaaaaaaa, aaaaaaaaa, aaaaaaaaa, aaaaaaaaaa, aaaaaaaaaa, aaaaaaa, aaa }, { aaaa, aaaa, aaaa, aaaa, aaaa, aaaa, aaaa, aaa }, { aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaa, a, aaaaaaaaaa, aaaaaaaaa, aaa }, }; After: SomeStruct my_struct_array = { { aaaaaa, aaaaaaaa, aaaaaaaaaa, aaaaaaaaa, aaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaaa, aaaaaaa, aaa }, { aaaa, aaaa, aaaa, aaaa, aaaa, aaaa, aaaa, aaa }, { aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaa, a, aaaaaaaaaa, aaaaaaaaa, aaa }, }; llvm-svn: 196783
* [-cxx-abi microsoft] Mangle large integral constants correctlyDavid Majnemer2013-12-092-46/+43
| | | | | | | | | | | | | | | | | | | Testing has revealed that large integral constants (i.e. > INT64_MAX) are always mangled as-if they are negative, even in places where it would not make sense for them to be negative (like non-type template parameters of type unsigned long long). To address this, we change the way we model number mangling: always mangle as-if our number is an int64_t. This should result in correct results when we have large unsigned numbers. N.B. Bizarrely, things that are 32-bit displacements like vbptr offsets are mangled as-if they are unsigned 32-bit numbers. This is a pretty egregious waste of space, it would be a 4x savings if we could mangle it like a signed 32-bit number. Instead, we explicitly cast these displacements to uint32_t and let the mangler proceed. llvm-svn: 196771
* Avoid extra error messages if method definition is inside function.Serge Pavlov2013-12-091-1/+2
| | | | llvm-svn: 196757
* Avoid adding some decls to DeferredDeclsToEmit.Rafael Espindola2013-12-094-77/+92
| | | | | | | | Before this patch GetOrCreateLLVMFunction would add a decl to DeferredDeclsToEmit even when it was being called by the function trying to emit that decl. llvm-svn: 196753
* [-cxx-abi microsoft] Properly mangle enumsDavid Majnemer2013-12-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing our ability to mangle large constants (PR18175), I incidentally discovered that we did not properly mangle enums correctly. Previously, we would append the width of the enum in bytes after the type-tag differentiator. This would mean "enum : short" would be mangled as 'W2' while "enum : char" would be mangled as 'W1'. Upon testing this with several versions of MSVC, I found that this did not match their behavior: they always use 'W4'. N.B. Quick testing uncovered that undname allows different numbers to follow the 'W' in the following way: 'W0' -> "enum char" 'W1' -> "enum unsigned char" 'W2' -> "enum short" 'W3' -> "enum unsigned short" 'W4' -> "enum" 'W5' -> "enum unsigned int" 'W6' -> "enum long" 'W7' -> "enum unsigned long" However this scheme appears abandoned, I cannot get MSVC to trigger it. Furthermore, it's incomplete: it doesn't handle "bool" or "long long". llvm-svn: 196752
* [AArch64]Add missing pair intrinsics such as:Hao Liu2013-12-091-0/+8
| | | | | | | int32_t vminv_s32(int32x2_t a) which should be compiled into SMINP Vd.2S,Vn.2S,Vm.2S llvm-svn: 196750
* Rename a variable that I missed in the previous refactoring.Faisal Vali2013-12-091-4/+4
| | | | llvm-svn: 196740
* GlobalAlias::isDeclaration is always false. Remove dead code.Rafael Espindola2013-12-081-5/+0
| | | | llvm-svn: 196727
* ARM: teach Sema that "r" can match 64-bit valuesTim Northover2013-12-081-1/+1
| | | | | | | | We already support using "r" on 64-bit values (a GPRPair is allocated), but Sema doesn't know this yet so issues a warning. This should fix it. llvm-svn: 196724
* Fix the message to go along with the assertion that was just fixed.Faisal Vali2013-12-081-1/+1
| | | | | | argh! llvm-svn: 196722
* Fix an assertion introduced by my previous refactoring.Faisal Vali2013-12-081-6/+4
| | | | | | Add back the test that was triggering the assertion (which I removed mistakenly thinking it was triggering just a warning and not an assertion). My error was brought to my attention by Rafael (Thanks!). llvm-svn: 196721
* Extend assembler handling for NetBSD/MIPS to pass down the correct ABI,Joerg Sonnenberger2013-12-081-5/+32
| | | | | | architecture and PIC flag. llvm-svn: 196720
* Fix pr18174.Rafael Espindola2013-12-081-1/+1
| | | | | | | | | | | | | | | Clang outputs LLVM one top level decl at a time. This combined with the visibility computation code looking for the newest NamespaceDecl would cause it to produce different results for nested namespaces. The two options for producing consistent results are * Delay codegen of anything inside a namespace until the end of the file. * Don't look for the newest NamespaceDecl. This patch implements the second option. This matches the gcc behavior too. llvm-svn: 196712
* [REFACTOR] Refactored some of the generic-lambda capturing code.Faisal Vali2013-12-073-135/+247
| | | | | | | | | | | | | | | Employed the following refactorings: - Renamed some functions - Introduced explaining variables - Cleaned up & added comments - Used Optional<unsigned> for return value instead of an out parameter - Added assertions - Constified a few member functions No functionality change. All regressions pass. llvm-svn: 196662
* CodeGen: Don't emit linkage on thunks that aren't emitted because they're ↵Benjamin Kramer2013-12-071-3/+4
| | | | | | | | | | | | vararg. This can happen when we're trying to emit a thunk with available_externally linkage with optimization enabled but bail because it doesn't make sense for vararg functions. PR18098. llvm-svn: 196658
* Eliminate the last trivial NDEBUG uses in clang headersAlp Toker2013-12-073-4/+7
| | | | | | assert(sanity()) reads so much better than preprocessor conditional blocks. llvm-svn: 196657
* CommentLexer: eliminate an NDEBUG from the headersAlp Toker2013-12-071-0/+13
| | | | | | Code in headers shouldn't be conditional on the build configuration. llvm-svn: 196656
* Changed ConditionValue argument to PPCallbacks If and Elif callbacks to be a ↵John Thompson2013-12-072-5/+5
| | | | | | 3-state enum. llvm-svn: 196648
* Tweak r196646Alp Toker2013-12-071-5/+3
| | | | | | | | | There was already a condition earlier in the function so just place the check there. Cleanup only. llvm-svn: 196647
OpenPOWER on IntegriCloud