summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* PR15311: Finish implementation of the suggested resolution of core issue 1488,Richard Smith2013-02-201-0/+7
| | | | | | | | which allows grouping parens in an abstract-pack-declarator. This was already mostly implemented, but missed some cases. Add an ExtWarn for use of this extension until CWG ratifies it. llvm-svn: 175660
* Process and handle attributes on conditions and for loop variables. Process andRichard Smith2013-02-207-28/+62
| | | | | | | diagnose attributes on alias declarations, using directives, and attribute declarations. llvm-svn: 175649
* Fix regression in string literal alignment.Manuel Klimek2013-02-201-1/+1
| | | | | | | | | Now correctly indents (again): a = a + "a" "a" "a"; llvm-svn: 175630
* Fixes bug in string literal alignment.Manuel Klimek2013-02-201-2/+15
| | | | | | | | | We now indent the following correctly: 1. some + "literal" /* comment */ "literal"; 2. breaking string literals after which we have another string literal. llvm-svn: 175628
* Don't remove blank lines within unwrapped lines.Daniel Jasper2013-02-202-7/+12
| | | | | | | | | | | | | | | | | If the code author decides to put empty lines anywhere into the code we should treat them equally, i.e. reduce them to the configured MaxEmptyLinesToKeep. With this change, we e.g. keep the newline in: SomeType ST = { // First value a, // Second value b }; llvm-svn: 175620
* Implements breaking of string literals if they stick out.Manuel Klimek2013-02-201-17/+97
| | | | | | | | | | An alternative strategy to calculating the break on demand when hitting a token that would need to be broken would be to put all possible breaks inside the token into the optimizer. Currently only supports breaking at spaces; more break points to come. llvm-svn: 175613
* Replace SVal llvm::cast support to be well-defined.David Blaikie2013-02-2040-422/+444
| | | | | | See r175462 for another example/more details. llvm-svn: 175594
* intmax_t is long long on Darwin, not long.Jordan Rose2013-02-201-0/+2
| | | | | | <rdar://problem/11540697> llvm-svn: 175588
* Add a new 'type_visibility' attribute to allow users toJohn McCall2013-02-206-87/+233
| | | | | | | | | | | | | | control the visibility of a type for the purposes of RTTI and template argument restrictions independently of how visibility propagates to its non-type member declarations. Also fix r175326 to not ignore template argument visibility on a template explicit instantiation when a member has an explicit attribute but the instantiation does not. The type_visibility work is rdar://11880378 llvm-svn: 175587
* Don't repeat the function name in the comment.Richard Smith2013-02-201-4/+4
| | | | llvm-svn: 175586
* [preprocessor] Split the MacroInfo class into two separate concepts, ↵Argyrios Kyrtzidis2013-02-2010-189/+164
| | | | | | | | | | | | | | | | | | | | | | | | | MacroInfo class for the data specific to a macro definition (e.g. what the tokens are), and MacroDirective class which encapsulates the changes to the "macro namespace" (e.g. the location where the macro name became active, the location where it was undefined, etc.) (A MacroDirective always points to a MacroInfo object.) Usually a macro definition (MacroInfo) is where a macro name becomes active (MacroDirective) but splitting the concepts allows us to better model the effect of modules to the macro namespace (also as a bonus it allows better modeling of push_macro/pop_macro #pragmas). Modules can have their own macro history, separate from the local (current translation unit) macro history; MacroDirectives will be used to model the macro history (changes to macro namespace). For example, if "@import A;" imports macro FOO, there will be a new local MacroDirective created to indicate that "FOO" became active at the import location. Module "A" itself will contain another MacroDirective in its macro history (at the point of the definition of FOO) and both MacroDirectives will point to the same MacroInfo object. Introducing the separation of macro concepts is the first part towards better modeling of module macros. llvm-svn: 175585
* [analyzer] Account for the "interesting values" hash table resizing.Jordan Rose2013-02-201-3/+3
| | | | | | | | | | | RegionStoreManager::getInterestingValues() returns a pointer to a std::vector that lives inside a DenseMap, which is constructed on demand. However, constructing one such value can lead to constructing another value, which will invalidate the reference created earlier. Fixed by delaying the new entry creation until the function returns. llvm-svn: 175582
* PR15300: Support C++11 attributes on base-specifiers. We don't support any suchRichard Smith2013-02-194-27/+63
| | | | | | | | attributes yet, so just issue the appropriate diagnostics. Also generalize the fixit for attributes-in-the-wrong-place code and reuse it here, if attributes are placed after the access-specifier or 'virtual' in a base specifier. llvm-svn: 175575
* [analyzer] Don't accidentally strip off base object regions for lazy bindings.Jordan Rose2013-02-191-21/+43
| | | | | | | | | | | | If a base object is at a 0 offset, RegionStoreManager may find a lazy binding for the entire object, then try to attach a FieldRegion or grandparent CXXBaseObjectRegion on top of that (skipping the intermediate region). We now preserve as many layers of base object regions necessary to make the types match. <rdar://problem/13239840> llvm-svn: 175556
* Add missing clang-format null pointer check..Daniel Jasper2013-02-191-1/+2
| | | | | | .. and a test that triggers it in valid albeit questionable code. llvm-svn: 175554
* [modules] Const'ify some functions of ModuleMap.Argyrios Kyrtzidis2013-02-191-12/+13
| | | | llvm-svn: 175552
* [modules] Refactor code from ASTReader::makeModuleVisible() into a new function,Argyrios Kyrtzidis2013-02-192-53/+60
| | | | | | Module::getExportedModules() so it can be reused. llvm-svn: 175548
* Use MapVector::pop_back() per LLVM r175538.Douglas Gregor2013-02-191-1/+1
| | | | llvm-svn: 175539
* Correctly format macro with unfinished template declaration.Daniel Jasper2013-02-191-1/+2
| | | | | | | | | We can now format: #define A template <typename T> Before this created a segfault :-/. llvm-svn: 175533
* [Sanitizer] If -fsanitize-blacklist= option is not explicitly specified, ↵Alexey Samsonov2013-02-192-0/+21
| | | | | | make Clang look for the default sanitizer-specific blacklist in the resource directory. llvm-svn: 175505
* Fix bug in LineState comparison function.Daniel Jasper2013-02-191-13/+13
| | | | | | | | | | | | | | The key bug was if (Other.StartOfLineLevel < StartOfLineLevel) .. instead of if (Other.StartOfLineLevel != StartOfLineLevel) .. Also cleaned up the function to be more consistent in the comparisons. llvm-svn: 175500
* More grammar.Eric Christopher2013-02-191-1/+1
| | | | llvm-svn: 175492
OpenPOWER on IntegriCloud