summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out ofRichard Smith2013-02-223-29/+179
| | | | | | | | the normal attribute-merging path, because we can't merge alignment attributes without knowing the complete set of alignment attributes which apply to a particular declaration. llvm-svn: 175861
* [libclang] Fix a crash with invalid code, while skip function bodies is enabled.Argyrios Kyrtzidis2013-02-222-3/+3
| | | | llvm-svn: 175860
* Decl.cpp/mergeTemplateLV(): Tweak a description. [-Wdocumentation]NAKAMURA Takumi2013-02-221-1/+1
| | | | llvm-svn: 175859
* Only suppress instance context if a member is actuallyJohn McCall2013-02-221-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | accessible in its declaring class; otherwise we might fail to apply [class.protected] when considering accessibility in derived classes. Noticed by inspection; <rdar://13270329>. I had an existing test wrong. Here's why it's wrong: Follow the rules (and notation) of [class.access]p5. The naming class (N) is B and the context (R) is D::getX. - 'x' as a member of B is protected, but R does not occur in a member or friend of a class derived from B. - There does exist a base class of B, A, which is accessible from R, and 'x' is accessible at R when named in A because 'x' as a member of A is protected and R occurs in a member of a class, D, that is derived from A; however, by [class.protected], the class of the object expression must be equal to or derived from that class, and A does not derive from D. llvm-svn: 175858
* [analyzer] Place all inlining policy checks into one palceAnna Zaks2013-02-221-175/+179
| | | | | | | | | | | | | Previously, we had the decisions about inlining spread out over multiple functions. In addition to the refactor, this commit ensures that we will always inline BodyFarm functions as long as the Decl is available. This fixes false positives due to those functions not being inlined when no or minimal inlining is enabled such (as shallow mode). llvm-svn: 175857
* Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,Richard Smith2013-02-224-2/+10
| | | | | | | | | | | to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting levels for parentheses, brackets and braces. Some code with heavy macro use exceeds the default limit of 256, but we don't want to increase it generally to avoid stack overflow on stack-constrained systems. llvm-svn: 175855
* [analyzer] Make sure a materialized temporary matches its bindings.Jordan Rose2013-02-222-45/+38
| | | | | | | | | | | | | | | | | This is a follow-up to r175830, which made sure a temporary object region created for, say, a struct rvalue matched up with the initial bindings being stored into it. This does the same for the case in which the AST actually tells us that we need to create a temporary via a MaterializeObjectExpr. I've unified the two code paths and moved a static helper function onto ExprEngine. This also caused a bit of test churn, causing us to go back to describing temporary regions without a 'const' qualifier. This seems acceptable; it's our behavior from a few months ago. <rdar://problem/13265460> (part 2) llvm-svn: 175854
* Fix regression in modeling assignments of an address of a variable to ↵Ted Kremenek2013-02-221-3/+1
| | | | | | itself. Fixes <rdar://problem/13226577>. llvm-svn: 175852
* Make sure we only use the output file as a base for debug splittingEric Christopher2013-02-221-1/+1
| | | | | | if we're compiling. llvm-svn: 175851
* objective-C arc: Diagnostic can not say to use bridgeFariborz Jahanian2013-02-221-8/+21
| | | | | | | casts with c++ named casts. Change notes to say use bridge with c-style cast instead. // rdar://12788838 llvm-svn: 175850
* [analyzer] Fix buildbot by not reusing a variable name.Jordan Rose2013-02-221-4/+4
| | | | llvm-svn: 175848
* Preproceessor: fix #if skipping under -traditional-cpp.Jordan Rose2013-02-221-1/+1
| | | | | | | | | | | | When parsing directives within skipped #if blocks, we don't want to retain any whitespace. Previously we were just skipping comments, but it's not possible to skip comments and retain other whitespace. This change matches the usual behavior for parsing directives (i.e. the behavior outside of skipped #if blocks). <rdar://problem/13267695> llvm-svn: 175840
* Make logic smaller.Eric Christopher2013-02-221-7/+4
| | | | llvm-svn: 175839
* Apply the 'nobuiltin' attribute to call sites when the user specifies ↵Bill Wendling2013-02-223-5/+11
| | | | | | `-fno-builtin' on the command line. llvm-svn: 175836
* [analyzer] Make sure a temporary object region matches its initial bindings.Jordan Rose2013-02-211-4/+31
| | | | | | | | | | | | | | | | When creating a temporary region (say, when a struct rvalue is used as the base of a member expr), make sure we account for any derived-to-base casts. We don't actually record these in the LazyCompoundVal that represents the rvalue, but we need to make sure that the temporary region we're creating (a) matches the bindings, and (b) matches its expression. Most of the time this will do exactly the same thing as before, but it fixes spurious "garbage value" warnings introduced in r175234 by the use of lazy bindings to model trivial copy constructors. <rdar://problem/13265460> llvm-svn: 175830
* Ignore visibility from enclosing template argumentsJohn McCall2013-02-212-61/+141
| | | | | | for explicit member specializations. llvm-svn: 175827
* Simplify code to use castAs rather than getAs + assert.David Blaikie2013-02-211-3/+2
| | | | | | Post commit review feedback on r175812 from Jordan Rose. llvm-svn: 175826
* Add back implicitly dropped const.David Blaikie2013-02-211-1/+1
| | | | | | | (found due to incoming improvements to llvm::cast machinery that will error on this sort of mistake) llvm-svn: 175817
* Fix formatting and tabs in file.Eric Christopher2013-02-211-26/+25
| | | | llvm-svn: 175815
* Don't pass -split-dwarf= to the backend unless we're on linux forEric Christopher2013-02-211-1/+3
| | | | | | now. llvm-svn: 175814
* Remove the SplitDebug action and replace with a set of commandsEric Christopher2013-02-216-82/+53
| | | | | | | in the compilation setup. Note that this doesn't currently work for -no-integrated-as. llvm-svn: 175813
* Replace ProgramPoint llvm::cast support to be well-defined.David Blaikie2013-02-2118-125/+117
| | | | | | See r175462 for another example/more details. llvm-svn: 175812
* Remove superfluous null pointer check. The pointer is used prior to this check.Ted Kremenek2013-02-211-7/+6
| | | | llvm-svn: 175807
* AST dumping: dump template instantiations only onceDmitri Gribenko2013-02-211-2/+8
| | | | | | | | Fixes infinite loop in PR15220. Patch by Philip Craig. llvm-svn: 175805
* Remove accidentally introduced no-op line.Daniel Jasper2013-02-211-1/+0
| | | | | | | Was used during experiments, but another if-statements a few lines before makes it (intentionally) useless. llvm-svn: 175803
* Teach serialized diagnostics about notes without locations.Ted Kremenek2013-02-212-2/+17
| | | | | | | | Along the way, improve a diagnostic for "previous declaration here" for implicit parameters. Fixes <rdar://problem/13211384>. llvm-svn: 175802
* Consistently put {} onto the same line for empty functions.Daniel Jasper2013-02-212-20/+20
| | | | | | | | | | | | | | | | | This fixes llvm.org/PR15167. Before: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL() : AAAAAAAA(10), BBBBBBBBB(10) { } LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL() : AAAAAAAA(10) {} After: LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL() : AAAAAAAA(10), BBBBBBBBB(10) {} LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL() : AAAAAAAA(10) {} llvm-svn: 175800
* Replace CFGElement llvm::cast support to be well-defined.David Blaikie2013-02-2117-88/+89
| | | | | | See r175462 for another example/more details. llvm-svn: 175796
* Patch for debug info of qualified-id types is 'id'Fariborz Jahanian2013-02-211-2/+8
| | | | | | By Adrian Pranti. llvm-svn: 175793
* Preprocessor: preserve whitespace in -traditional-cpp mode.Jordan Rose2013-02-213-28/+35
| | | | | | | | | Note that unlike GNU cpp we currently do not preserve whitespace in macros (even in -traditional-cpp mode). <rdar://problem/12897179> llvm-svn: 175778
* [driver] Add a dump method for ArgList.Chad Rosier2013-02-211-0/+8
| | | | llvm-svn: 175777
* Allow breaking between type and name in for loops.Daniel Jasper2013-02-212-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes llvm.org/PR15033. Also: Always break before a parameter, if the previous parameter was split over multiple lines. This was necessary to make the right decisions in for-loops, almost always makes the code more readable and also fixes llvm.org/PR14873. Before: for (llvm::ArrayRef<NamedDecl *>::iterator I = FD->getDeclsInPrototypeScope() .begin(), E = FD->getDeclsInPrototypeScope().end(); I != E; ++I) { } foo(bar(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccc), d, bar(e, f)); After: for (llvm::ArrayRef<NamedDecl *>::iterator I = FD->getDeclsInPrototypeScope().begin(), E = FD->getDeclsInPrototypeScope().end(); I != E; ++I) { } foo(bar(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb, ccccccccccccccccccccccccccccc), d, bar(e, f)); llvm-svn: 175741
* Add support to Sema and CodeGen for floating point vector types in OpenCL.Joey Gouly2013-02-212-16/+66
| | | | llvm-svn: 175734
* Avoid implicit conversions of Optional<T> to bool.David Blaikie2013-02-212-4/+4
| | | | | | | This is a precursor to making Optional<T>'s operator bool 'explicit' when building Clang & LLVM as C++11. llvm-svn: 175722
* StaticAnalyzer/Core: Suppress warnings. [-Wunused-variable, -Wunused-function]NAKAMURA Takumi2013-02-211-2/+3
| | | | llvm-svn: 175721
* Whitespace.NAKAMURA Takumi2013-02-211-1/+1
| | | | llvm-svn: 175720
* [analyzer] Record whether a base object region represents a virtual base.Jordan Rose2013-02-214-50/+65
| | | | | | | | | This allows MemRegion and MemRegionManager to avoid asking over and over again whether an class is a virtual base or a non-virtual base. Minor optimization/cleanup; no functionality change. llvm-svn: 175716
* [analyzer] Tidy up a few uses of Optional in RegionStore.Jordan Rose2013-02-211-10/+7
| | | | | | | | | Some that I just added needed conversion to use 'None', others looked better using Optional<SVal>::create. No functionality change. llvm-svn: 175714
* libstdc++'s <cstdalign> #includes <stdalign.h> and expects it to guard againstRichard Smith2013-02-211-0/+3
| | | | | | | | | being included in C++. Don't define alignof or alignas in this case. Note that the C++11 standard is broken in various ways here (it refers to the contents of <stdalign.h> in C99, where that header did not exist, and doesn't mention the alignas macro at all), but we do our best to do what it intended. llvm-svn: 175708
* Respect -fno-canonical-prefixes when deciding where to generate .gcno and .gcdaNick Lewycky2013-02-211-3/+7
| | | | | | files. llvm-svn: 175706
* Use None rather than Optional<T>() where possible.David Blaikie2013-02-2118-48/+45
| | | | llvm-svn: 175705
* Rename TypeLoc's isType to isKindDavid Blaikie2013-02-211-3/+3
| | | | | | | | | | Matches changes made to SVal's similar functions based on Jordan Rose's review feedback to r175594. Also change isKind to take a reference rather than a non-null pointer, while I'm at it. (& make TypeLoc::isKind private) llvm-svn: 175704
* [analyzer] Tighten up safety in the use of lazy bindings.Jordan Rose2013-02-211-71/+79
| | | | | | | | | | | | | | | - When deciding if we can reuse a lazy binding, make sure to check if there are additional bindings in the sub-region. - When reading from a lazy binding, don't accidentally strip off casts or base object regions. This slows down lazy binding reading a bit but is necessary for type sanity when treating one class as another. A bit of minor refactoring allowed these two checks to be unified in a nice early-return-using helper function. <rdar://problem/13239840> llvm-svn: 175703
* Remove commented out code.Richard Trieu2013-02-211-1/+1
| | | | llvm-svn: 175699
* objective-C arc IR-gen. Retaining of strongFariborz Jahanian2013-02-211-8/+17
| | | | | | | | | | arguments in function prologue is done with objc_StoreStrong to pair it with similar objc_StoreStrong for release in function epilogue. This is done with -O0 only. // rdar://13145317 llvm-svn: 175698
* Revert "intmax_t is long long on Darwin, not long."Jordan Rose2013-02-201-2/+0
| | | | | | | | | 'long' and 'long long' are different for the purposes of mangling. This caused <rdar://problem/13254874>. This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c. llvm-svn: 175681
* MCParser: Update method names per coding guidelines.Jim Grosbach2013-02-201-1/+1
| | | | | | s/ParseMSInlineAsm/parseMSInlineAsm/ llvm-svn: 175680
* Include llvm::Optional in clang/Basic/LLVM.hDavid Blaikie2013-02-2059-362/+311
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175679
* Remove redundant Optional type in favor of llvm::OptionalDavid Blaikie2013-02-201-24/+4
| | | | llvm-svn: 175678
* Use op-> directly rather than via Optional<T>::getPointer.David Blaikie2013-02-201-2/+2
| | | | | | Post-commit CR feedback from Jordan Rose regarding r175594. llvm-svn: 175677
OpenPOWER on IntegriCloud