summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Sure-up MemoryBuffer ownership in JSONCompilationDatabase's ctor.David Blaikie2014-08-082-4/+5
| | | | llvm-svn: 215246
* Change __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ for versions > 10.9.Bob Wilson2014-08-082-6/+19
| | | | | | | | 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-082-53/+40
| | | | | | | | 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
* Objective-C. Minor refactoring of my previous patch.Fariborz Jahanian2014-08-081-36/+29
| | | | | | rdar://17554063 llvm-svn: 215235
* Objective-C ARC. Use of non-retain/autorelease APIFariborz Jahanian2014-08-089-21/+69
| | | | | | | for building Objective-C array literals in ARC mode. rdar://17554063 llvm-svn: 215232
* Fix a bug when scan-build is used in a cross-compilation environment withSylvestre Ledru2014-08-081-2/+13
| | | | | | | | | | | | | the --use-cc option. Instead, we will search in the PATH For example: scan-build --use-cc=arm-none-eabi-gcc -o out make -e Initially reported as a Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=748777 llvm-svn: 215229
* DebugInfo: Blocks: Do not depend on LLVM argument numbering when choosing ↵David Blaikie2014-08-084-3/+30
| | | | | | | | | | | | the debug info argument numbering. Due to the possible presence of return-by-out parameters, using the LLVM argument number count when numbering debug info arguments can end up off-by-one. This could produce two arguments with the same number, which would in turn cause LLVM to emit only one of those arguments (whichever it found last) or assert (r215157). llvm-svn: 215227
* CompilationDatabase: Sure-up ownership of compilation databases using ↵David Blaikie2014-08-086-40/+39
| | | | | | | | | | | | | std::unique_ptr Diving into the memory leaks fixed by r213851 there was one case of a memory leak of a CompilationDatabase due to not properly taking ownership of the result of "CompilationDatabase::autoDetectFromSource". Given that both implementations and callers have been using unique_ptr to own CompilationDatabase objects - make this explicit in the API to reduce the risk of further leaks. llvm-svn: 215215
* [mips] Invert the abicalls feature bit to be noabicalls so that it's ↵Daniel Sanders2014-08-083-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | possible for -mno-abicalls to take effect. Also added the testcase that should have been in r215194. This behaviour has surprised me a few times now. The problem is that the generated MipsSubtarget::ParseSubtargetFeatures() contains code like this: if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true; so '-abicalls' means 'leave it at the default' and '+abicalls' means 'set it to true'. In this case, (and the similar -modd-spreg case) I'd like the code to be IsABICalls = (Bits & Mips::FeatureABICalls) != 0; or possibly: if ((Bits & Mips::FeatureABICalls) != 0) IsABICalls = true; else IsABICalls = false; and preferably arrange for 'Bits & Mips::FeatureABICalls' to be true by default (on some triples). llvm-svn: 215211
* Expose the CUDA shared attribute to the C API.Eli Bendersky2014-08-085-3/+11
| | | | | | | | Similar to r209767, which exposed other CUDA-related attributes. Patch by Rob Springer. llvm-svn: 215208
* [mips] Add -mabicalls/-mno-abicalls to the driverDaniel Sanders2014-08-085-40/+90
| | | | | | | Based on a patch by Matheus Almeida. I've added testcases and fixed a bug where the options weren't passed on to GAS. llvm-svn: 215204
* Add missing header guards.Benjamin Kramer2014-08-084-0/+19
| | | | llvm-svn: 215202
* clang-format: Prefer not to put lambdas on a single line.Daniel Jasper2014-08-082-0/+5
| | | | | | | | | | | | | | Before: string abc = SomeFunction(aaaaaaaaaaaaa, aaaaa, []() { SomeOtherFunctioooooooooooooooooooooooooon(); }); After: string abc = SomeFunction(aaaaaaaaaaaaa, aaaaa, []() { SomeOtherFunctioooooooooooooooooooooooooon(); }); llvm-svn: 215197
* clangAnalysis: Avoid member initializers in TempDtorContext to appease msc17.NAKAMURA Takumi2014-08-081-5/+8
| | | | llvm-svn: 215193
* Fix branch reachabiliy annotation for temp dtor branches.Manuel Klimek2014-08-082-23/+43
| | | | | | | | | As we only create temp dtor decision branches when a temp dtor needs to be run (as opposed to for each logical branch in the original expression), we must include the information about all previous logical branches when we annotate the temp dtor decision branch. llvm-svn: 215188
* Parser: Array decls with static but without array size are illformedDavid Majnemer2014-08-083-0/+8
| | | | | | | | | | | | Array declarators involving the static keyword take on two forms: D[ static type-qualifier-listopt assignment-expression ] D[ type-qualifier-list static assignment-expression ] Raise a diagnostic if the assignment-expression is missing. This fixes PR20584. llvm-svn: 215187
* [CMake] Upate libdeps in FrontendTests corresponding to r215145.NAKAMURA Takumi2014-08-081-0/+1
| | | | llvm-svn: 215177
* MS ABI: Don't force bases to have an inheritance modelDavid Majnemer2014-08-083-8/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, assigning an inheritance model to a derived class would trigger further assiginments to the various bases of the class. This was done to fix a bug where we couldn't handle an implicit base-to-derived conversion for pointers-to-members when the conversion was ambiguous at an earlier point. However, this is not how the MS scheme works. Instead, assign inheritance models to *just* the class which owns to declaration we ended up referencing. N.B. This result is surprising in many ways. It means that it is possible for a base to have a "larger" inheritance model than it's derived classes. It also means that bases in the conversion path do not get assigned a model. struct A { void f(); void f(int); }; struct B : A {}; struct C : B {}; void f() { void (C::*x)() = &A::f; } We can only begin to assign an inheritance model *after* we've seen the address-of but *before* we've done the implicit conversion the more derived pointer-to-member type. After that point, both 'A' and 'C' will have an inheritance model but 'B' will not. Surprising, right? llvm-svn: 215174
* MS ABI: Handle member function pointers returning a member data pointerDavid Majnemer2014-08-075-1/+39
| | | | | | | | | MSVC doesn't decide what the inheritance model for a returned member pointer *until* a call expression returns it. This fixes PR20017. llvm-svn: 215164
* Temporarily Revert "Update for llvm API change."Eric Christopher2014-08-071-0/+1
| | | | | | This reverts commit 215113 to match the reversion in llvm. llvm-svn: 215156
* Debug info: Use the vbtable offset for virtual bases in the MS ABIReid Kleckner2014-08-072-7/+27
| | | | | | | | There are no vtable offset offsets in the MS ABI, but vbtable offsets are analogous. There are no consumers of this information yet, but at least we don't crash now. llvm-svn: 215149
* [modules] Don't defer performing updates if we have incomplete redecl chains.Richard Smith2014-08-072-25/+39
| | | | | | Instead, perform them carefully immediately. llvm-svn: 215147
* Objective-C arc. Switch the Objective-C dictionary literal in ARC modeFariborz Jahanian2014-08-076-13/+32
| | | | | | | to use non-retain/autorelease API variants of ObjC objects. wip. rdar://17554063 llvm-svn: 215146
* Flip the order the preprocessor and frontendaction are informed of the end ↵Benjamin Kramer2014-08-072-4/+50
| | | | | | | | | | | of a file. This allows using EndOfMainFile from a PPCallback to access data from the action. The pattern of PPCallback referencing an action is common in clang-tidy. Differential Revision: http://reviews.llvm.org/D4773 llvm-svn: 215145
* Revert "Debug info: Use record layout to find vbase offsets instead of vtables"Reid Kleckner2014-08-072-9/+5
| | | | | | | | | This reverts commit r215137. This doesn't work at all, an offset-offset is probably different than an offset. I'm scared that this passed our normal test suite. llvm-svn: 215141
* Debug info: Use record layout to find vbase offsets instead of vtablesReid Kleckner2014-08-072-5/+9
| | | | | | | | | This fixes an assertion when generating full debug info in the MS ABI for classes with virtual bases. Fixes PR20579. llvm-svn: 215137
* [modules] When emitting an update record containing the body of a destructor,Richard Smith2014-08-076-14/+38
| | | | | | | | | also emit the updated 'operator delete' looked up for that destructor. Switch from UpdateDecl to an actual update record when this happens due to implicitly defining a special member function and unify this code path and the one for instantiating a function definition. llvm-svn: 215132
* test/Modules: Use FileCheck's -allow-empty instead of "count 0"Justin Bogner2014-08-071-2/+5
| | | | | | | | | | Piping stderr into "count 0" in tests doesn't work - things like guard malloc write to stderr and mess up the count. This comes up all the time, so I've added a feature to FileCheck to fix it this time. Fixes test failures caused by r215046 under guard malloc. llvm-svn: 215129
* Mark successors as reachable/unreachable instead of changing the CFG.Manuel Klimek2014-08-072-35/+22
| | | | | | As suggested by Ted, this makes a few warnings less aggressive. llvm-svn: 215128
* Fix CFG for temporary dtors when the branch taken is known.Manuel Klimek2014-08-072-14/+29
| | | | | | | Use the parent context when visiting temporaries when we do not insert a temporary dtor decision branch. llvm-svn: 215120
* Model temporary destructors from logical operators with known values.Manuel Klimek2014-08-072-4/+31
| | | | | | | | If the truth value of a LHS is known, we can build the knowledge whether a temporary destructor is executed or not into the CFG. This is needed by the return type analysis. llvm-svn: 215118
* Only have one path in the CFG for ternaries if the condition is known.Manuel Klimek2014-08-072-2/+27
| | | | | | | The return type analysis requires that the CFG is simplified when the truth values of branches are statically known at analysis time. llvm-svn: 215114
* Update for llvm API change.Rafael Espindola2014-08-071-1/+0
| | | | llvm-svn: 215113
* Re-applying r214962.Manuel Klimek2014-08-079-217/+533
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to the original patch: - model the CFG for temporary destructors in conditional operators so that the destructors of the true and false branch are always exclusive. This is necessary because we must not have impossible paths for the path based analysis to work. - add multiple regression tests with ternary operators Original description: Fix modelling of non-lifetime-extended temporary destructors in the analyzer. Changes to the CFG: When creating the CFG for temporary destructors, we create a structure that mirrors the branch structure of the conditionally executed temporary constructors in a full expression. The branches we create use a CXXBindTemporaryExpr as terminator which corresponds to the temporary constructor which must have been executed to enter the destruction branch. 2. Changes to the Analyzer: When we visit a CXXBindTemporaryExpr we mark the CXXBindTemporaryExpr as executed in the state; when we reach a branch that contains the corresponding CXXBindTemporaryExpr as terminator, we branch out depending on whether the corresponding CXXBindTemporaryExpr was marked as executed. llvm-svn: 215096
* Driver: Add tests for -fprofile-arcs and -fno-profile-arcsJustin Bogner2014-08-071-0/+7
| | | | | | | I tried to be lazy and get away with no test in r215051, but Chad caught me :) llvm-svn: 215053
* Driver: Add -fno-profile-arcs to go with -fprofile-arcsJustin Bogner2014-08-073-3/+7
| | | | | | This is a trivial gcc-compatible change. llvm-svn: 215051
* Update the context location of the condition of a conditional operator to theRichard Trieu2014-08-071-1/+1
| | | | | | | question mark instead of the context of the conditional operator. The condition does not need the context of the conditional operator at all. llvm-svn: 215048
* Make FullExprArg trivially copyable by removing the copy ctorReid Kleckner2014-08-071-5/+0
| | | | | | | The default copy ctor is good. This avoids using inalloca for a bunch of Sema methods when self-hosting. llvm-svn: 215047
* Use -Rblah, not -Wblah, to control remark diagnostics. This was always theRichard Smith2014-08-0720-115/+223
| | | | | | | | | | | | | | | | | | | | | | intent when we added remark support, but was never implemented in the general case, because the first -R flags didn't need it. (-Rpass= had special handling to accomodate its argument.) -Rno-foo, -Reverything, and -Rno-everything can be used to turn off a remark, or to turn on or off all remarks. Per discussion on cfe-commits, -Weverything does not affect remarks, and -Reverything does not affect warnings or errors. The only "real" -R flag we have right now is -Rmodule-build; that flag is effectively renamed from -Wmodule-build to -Rmodule-build by this change. -Wpass and -Wno-pass (and their friends) are also renamed to -Rpass and -Rno-pass by this change; it's not completely clear whether we intended to have a -Rpass (with no =pattern), but that is unchanged by this commit, other than the flag name. The default pattern is effectively one which matches no passes. In future, we may want to make the default pattern be .*, so that -Reverything works for -Rpass properly. llvm-svn: 215046
* Add back the leading space when printing commands with -###Reid Kleckner2014-08-071-0/+1
| | | | | | This was an unintentional behavior change from r214924. llvm-svn: 215044
* Objective-C ARC. More code for Objective-C'sFariborz Jahanian2014-08-068-10/+51
| | | | | | new APIs for literals. nfc. wip. rdar://17554063 llvm-svn: 215043
* Revert "Fix modelling of non-lifetime-extended temporary destructors in the ↵Rui Ueyama2014-08-068-715/+425
| | | | | | | | | | | | | | | | | | | | analyzer." This reverts commit r214962 because after the change the following code doesn't compile with -Wreturn-type -Werror. #include <cstdlib> class NoReturn { public: ~NoReturn() __attribute__((noreturn)) { exit(1); } }; int check() { true ? NoReturn() : NoReturn(); } llvm-svn: 214998
* Objective-C ARC. Adding declarations for Objective-C'sFariborz Jahanian2014-08-064-4/+35
| | | | | | new APIs for literals. nfc. wip. rdar://17554063 llvm-svn: 214993
* Objective-C ARC. First patch toward generating new APIsFariborz Jahanian2014-08-068-10/+49
| | | | | | | for Objective-C's array and dictionary literals. rdar://17554063. This is wip. llvm-svn: 214983
* FormatTokenLexer: Avoid non-static member initializer.NAKAMURA Takumi2014-08-061-2/+2
| | | | llvm-svn: 214976
* Remove unnecessary semicolon.Manuel Klimek2014-08-061-1/+1
| | | | llvm-svn: 214970
* clang-format: Correct SBPO_Always-behavior after function-like keywordsDaniel Jasper2014-08-063-1/+35
| | | | | | | | | | | | | | | | | Before: auto f (int x) -> decltype(x) { return sizeof(x); } int g () noexcept(someCall ()); static_assert(sizeof(char) == 1, "Your compiler is broken"); After: auto f (int x) -> decltype (x) { return sizeof (x); } int g () noexcept (someCall ()); static_assert (sizeof (char) == 1, "Your compiler is broken"); This fixes llvm.org/PR20559. Patch by Roman Kashitsyn, thank you! llvm-svn: 214969
* Fix sphinx warning.Dan Liew2014-08-061-1/+1
| | | | llvm-svn: 214967
* clang-format: Add special comments to disable formatting.Daniel Jasper2014-08-062-0/+20
| | | | | | | | | | | | | | | | With this patch: int ThisWillBeFormatted; // clang-format off int ThisWontBeFormatted; // clang-format on int Formatted; This is for regions where a significantly nicer code layout can be found knowing the content of the code. This fixes llvm.org/PR20463. llvm-svn: 214966
OpenPOWER on IntegriCloud