summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Rename ANDROIDEABI to Android.Logan Chien2012-09-025-8/+23
| | | | | | | | | | | | | Most of the code guarded with ANDROIDEABI are not ARM-specific, and having no relation with arm-eabi. Thus, it will be more natural to call this environment "Android" instead of "ANDROIDEABI". Note: We are not using ANDROID because several projects are using "-DANDROID" as the conditional compilation flag. llvm-svn: 163088
* Documentation cleanup: Add \file comment for ASTContest.h, add \brief to manyJames Dennett2012-09-021-253/+289
| | | | | | | items, remove redundant names from doc comments, fix various typos, and tidy up some wording. llvm-svn: 163085
* Implemented parsing and AST support for the MS __leave exception statement. ↵Joao Matos2012-09-0219-3/+119
| | | | | | Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review. llvm-svn: 163083
* Include the diagnostic introduced in r163078 in a group.Joao Matos2012-09-021-2/+1
| | | | llvm-svn: 163079
* Added a diagnostic for mismatched MS inheritance attributes. Also fixed the ↵Joao Matos2012-09-025-25/+62
| | | | | | incomplete type member pointer size calculation under the MS ABI. llvm-svn: 163078
* Fixed typo causing tests to fail on non-MSVC machines.Joao Matos2012-09-011-1/+1
| | | | llvm-svn: 163077
* Refactored the Windows headers location lookup code. Expose it so standalone ↵Joao Matos2012-09-012-22/+39
| | | | | | tools can have access to it. llvm-svn: 163076
* [analyzer] Silence unused variable warnings in NDEBUG builds.Jordan Rose2012-09-011-0/+2
| | | | | | No functionality change. llvm-svn: 163073
* [libclang] Fix indexing type alias declarations. rdar://11878406Argyrios Kyrtzidis2012-09-012-1/+7
| | | | llvm-svn: 163072
* [libclang] The annotation of tokens operation visits statement nodes ↵Argyrios Kyrtzidis2012-09-013-12/+176
| | | | | | | | | | | | | | code-recursively. This can blow the stack with extremely deep hierarchies. Switch it to data-recursive. This is implemented by introducing a post-children visitation callback that the CursorVisitor is calling after child nodes of a cursor have been visited. This is used by the annotate-tokens visitor to do extra work at that point. rdar://11979525. llvm-svn: 163071
* [analyzer] Disallow creation of int vals with explicit bit width / signedness.Jordan Rose2012-09-014-11/+9
| | | | | | | | | | All clients of BasicValueFactory should be using QualTypes instead, and indeed it seems they are. This caught the (fortunately harmless) bug fixed in the previous commit. No intended functionality change. llvm-svn: 163069
* [analyzer] Don't attempt to create a floating-point value of "1" for ++/--.Jordan Rose2012-09-011-1/+3
| | | | | | | | | | | The current logic would actually create a float- or double-sized signed integer value of 1, which is not at all the same. No test because the value would be swallowed by an Unknown as soon as it gets added or subtracted to the original value, but it enables the cleanup in the next patch. llvm-svn: 163068
* [analyzer] Future-proofing r163012 (nameless functions and RetainCountChecker)Jordan Rose2012-09-011-4/+4
| | | | | | | | | Any future exceptions need to go INSIDE the test that checks if the IdentifierInfo is non-null! No functionality change. Thanks for the review, Ted. llvm-svn: 163067
* [analyzer] Treat all struct values as regions (even rvalues).Jordan Rose2012-09-016-13/+124
| | | | | | | | | | | | | | | | | This allows us to correctly symbolicate the fields of structs returned by value, as well as get the proper 'this' value for when methods are called on structs returned by value. This does require a moderately ugly hack in the StoreManager: if we assign a "struct value" to a struct region, that now appears as a Loc value being bound to a region of struct type. We handle this by simply "dereferencing" the struct value region, which should create a LazyCompoundVal. This should fix recent crashes analyzing LLVM and on our internal buildbot. <rdar://problem/12137950> llvm-svn: 163066
* [analyzer] Always derive a CallEvent's return type from its origin expr.Jordan Rose2012-09-016-133/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we preferred to get a result type by looking at the callee's declared result type. This allowed us to handlereferences, which are represented in the AST as lvalues of their pointee type. (That is, a call to a function returning 'int &' has type 'int' and value kind 'lvalue'.) However, this results in us preferring the original type of a function over a casted type. This is a problem when a function pointer is casted to another type, because the conjured result value will have the wrong type. AdjustedReturnValueChecker is supposed to handle this, but still doesn't handle the case where there is no "original function" at all, i.e. where the callee is unknown. Now, we instead look at the call expression's value kind (lvalue, xvalue, or prvalue), and adjust the expr's type accordingly. This will have no effect when the function is inlined, and will conjure the value that will actually be used when it is not. This makes AdjustedReturnValueChecker /nearly/ unnecessary; unfortunately, the cases where it would still be useful are where we need to cast the result of an inlined function or a checker-evaluated function, and in these cases we don't know what we're casting /from/ by the time we can do post- call checks. In light of that, remove AdjustedReturnValueChecker, which was already not checking quite a few calls. llvm-svn: 163065
* [cindex.py] Add helper to initialize libclang functionsTobias Grosser2012-09-011-385/+533
| | | | | | | | | | | | | | | | The helper allows us to define how the initialization of functions should behave. We use this patch to provide an informative error message, in case a function is not available: "LibclangError: /home/grosser/Projekte/llvm/install/lib/libclang.so: undefined symbol: clang_method_added_in_2020. Please ensure that your python bindings are compatible with your libclang.so version." This patch also ensures that no spelling mistakes slip into the library initialization. At the moment, there are a couple of 'argtype' -> 'argtypes' mispellings that have been overlooked. llvm-svn: 163057
* Comment that clang.dll is unavailable on cygming yet.Ted Kremenek2012-09-011-0/+3
| | | | llvm-svn: 163055
* c-arcmt-test/Makefile: Restore some stuff. clang.dll is unavailable on ↵NAKAMURA Takumi2012-09-011-2/+8
| | | | | | cygming yet. llvm-svn: 163054
* Tweak link order to hopefully resolve a buildbot failure.Ted Kremenek2012-09-011-1/+1
| | | | llvm-svn: 163052
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-0154-100/+163
| | | | | | | This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
* Changed the remaining dead asserts to llvm_unreachable.Joao Matos2012-09-013-21/+15
| | | | llvm-svn: 163039
* don't warn about unused values when the unused value is a statement ↵Chris Lattner2012-08-312-0/+15
| | | | | | expression expanded from a macro. This is of dubious utility in general, but is specifically a major issue for the linux kernel. This resolves PR13747. llvm-svn: 163034
* Normalize line endings of r163013 (part 2).Joao Matos2012-08-3115-332/+332
| | | | llvm-svn: 163032
* Remove windows line endings.Benjamin Kramer2012-08-311-36/+34
| | | | | | While there fix a dead assert. llvm-svn: 163031
* Thread-safety analysis: fix handling of LOCK_RETURNED attribute so that theDeLesley Hutchins2012-08-312-4/+51
| | | | | | latest definition of a function is always used when computing lock expressions. llvm-svn: 163028
* Update a warning to point to the DiagGroup created in DiagnosticGroups.tdRichard Trieu2012-08-311-1/+1
| | | | | | instead of referring to the flag name. llvm-svn: 163027
* Thread-safety analysis: fix handling of string constants in mutexDeLesley Hutchins2012-08-313-2/+51
| | | | | | expressions, which should be ignored right now. llvm-svn: 163026
* Fix the build (-Wswitch violation introduced by r163013).David Blaikie2012-08-311-0/+1
| | | | llvm-svn: 163025
* Normalize line endings of r163013.Joao Matos2012-08-311-935/+935
| | | | llvm-svn: 163024
* Normalize line endings of r163022.Joao Matos2012-08-312-1178/+1177
| | | | llvm-svn: 163023
* Emulate MSVC's preprocessor macro argument separator behavior by not ↵Joao Matos2012-08-314-1174/+1192
| | | | | | considering commas from nested macro expansions as argument separators. Fixes parsing of VS 2012 headers. llvm-svn: 163022
* objective-C ARC; detect and warn on retain cycle whenFariborz Jahanian2012-08-312-0/+10
| | | | | | | property-dot syntax is used on an object whose capture causes retain cycle. // rdar://11702054 llvm-svn: 163017
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-3130-1247/+1414
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* [analyzer] RetainCountChecker: don't assume all functions have names.Jordan Rose2012-08-313-5/+29
| | | | | | | | | | | | | | | Fixes a hard-to-reach crash when calling a non-member overloaded operator with arguments that may be callbacks. Future-proofing: don't make the same assumption in MallocSizeofChecker. Aside from possibly respecting attributes in the future, it might be possible to call 'malloc' through a function pointer. I audited all other uses of FunctionDecl::getIdentifier() in the analyzer; they all now correctly test to see if the identifier is present before using it. llvm-svn: 163012
* Fixed invalid iterators. Since the iterator is invalidated after the erase() ↵Joao Matos2012-08-311-1/+1
| | | | | | call, we need to replace it with the new one returned. This was triggering an assert under MSVC 2012 and making all the ARCMT/ tests fail. llvm-svn: 163007
* [analyzer] Though C++ inlining is enabled, don't inline ctors and dtors.Jordan Rose2012-08-3111-57/+143
| | | | | | | | | | | | | | | | More generally, this adds a new configuration option 'c++-inlining', which controls which C++ member functions can be considered for inlining. This uses the new -analyzer-config table, so the cc1 arguments will look like this: ... -analyzer-config c++-inlining=[none|methods|constructors|destructors] Note that each mode implies that all the previous member function kinds will be inlined as well; it doesn't make sense to inline destructors without inlining constructors, for example. The default mode is 'methods'. llvm-svn: 163004
* objective-C: underline name of the missing methodFariborz Jahanian2012-08-312-4/+10
| | | | | | in the diagnbostic. // rdar://11303469 llvm-svn: 163003
* Remove the useless CommentOptions class.Dmitri Gribenko2012-08-315-14/+7
| | | | llvm-svn: 162986
* Use LLVM_DELETED_FUNCTION instead of a comment.Dmitri Gribenko2012-08-313-6/+6
| | | | llvm-svn: 162985
* Make AnalyzerOptions a shared object between CompilerInvocation andTed Kremenek2012-08-317-31/+30
| | | | | | | AnalysisManager, allowing the StringMap of configuration values to be propagated. llvm-svn: 162978
* Move AnalyzerOptions.h into 'Core' StaticAnalyzer sub-library.Ted Kremenek2012-08-317-26/+26
| | | | llvm-svn: 162977
* DeclPrinter tests: simplify the code by using the new runToolOnCodeWithArgsDmitri Gribenko2012-08-311-27/+10
| | | | | | function from Tooling. llvm-svn: 162976
* Documentation: correct a typo introduced in r162971.Dmitri Gribenko2012-08-311-1/+1
| | | | llvm-svn: 162975
* DeclPrinter tests: since now some platforms use C++11 by default, make itDmitri Gribenko2012-08-311-105/+97
| | | | | | explicitly visible in test cases which language variant is used. llvm-svn: 162974
* Documentation: add missing word "accepts".Dmitri Gribenko2012-08-311-2/+2
| | | | llvm-svn: 162971
* Make a bunch of methods on Lexer private.Eli Friedman2012-08-312-21/+18
| | | | llvm-svn: 162970
* Comment HTML tag name machers: move from StringSwitch to an efficientDmitri Gribenko2012-08-3111-55/+172
| | | | | | TableGen-generated string matcher. llvm-svn: 162969
* Revert "[analyzer] Disable diagnostic checking on the buildbot."Jordan Rose2012-08-311-8/+6
| | | | | | | This reverts commit befc0f648c83f65e1f3567f2058c7c18b4bc3ad8 now that plist-html diagnostics are working again. llvm-svn: 162966
* [analyzer] Ensure that PathDiagnostics profile the same regardless of path.Jordan Rose2012-08-319-65/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | PathDiagnostics are actually profiled and uniqued independently of the path on which the bug occurred. This is used to merge diagnostics that refer to the same issue along different paths, as well as by the plist diagnostics to reference files created by the HTML diagnostics. However, there are two problems with the current implementation: 1) The bug description is included in the profile, but some PathDiagnosticConsumers prefer abbreviated descriptions and some prefer verbose descriptions. Fixed by including both descriptions in the PathDiagnostic objects and always using the verbose one in the profile. 2) The "minimal" path generation scheme provides extra information about which events came from macros that the "extensive" scheme does not. This resulted not only in different locations for the plist and HTML diagnostics, but also in diagnostics being uniqued in the plist output but not in the HTML output. Fixed by storing the "end path" location explicitly in the PathDiagnostic object, rather than trying to find the last piece of the path when the diagnostic is requested. This should hopefully finish unsticking our internal buildbot. llvm-svn: 162965
* [analyzer] Fix a crash in plist-html generation introduced in r162939.Jordan Rose2012-08-311-12/+13
| | | | | | | Basically, do the correct thing to fix the XML generation error, rather than making it even worse by unilaterally dereferencing a null pointer. llvm-svn: 162964
OpenPOWER on IntegriCloud