summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Slightly improve formatting of longer pipe statements.Daniel Jasper2013-03-141-4/+5
| | | | | | | | | | | | | | | The stronger binding of a string ending in :/= does not really make sense if it is the only character. Before: llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa << "=" << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; After: llvm::outs() << aaaaaaaaaaaaaaaaaaaaaaaa << "=" << bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb; llvm-svn: 177075
* Basic support for formatting asm() statments.Daniel Jasper2013-03-143-18/+27
| | | | llvm-svn: 177073
* [ASan] Make -fsanitize=address imply -fsanitize=init-order (if the latter is ↵Alexey Samsonov2013-03-141-0/+8
| | | | | | not explicitly disabled). llvm-svn: 177061
* Fix dereference formatting in for-loops.Daniel Jasper2013-03-141-1/+1
| | | | | | Before: for (char **a = b; * a; ++a) {} After: for (char **a = b; *a; ++a) {} llvm-svn: 177037
* Add support for the 'endian' attribute for OpenCL.Joey Gouly2013-03-141-0/+13
| | | | llvm-svn: 177035
* Improve formatting of trailing annotations.Daniel Jasper2013-03-141-4/+4
| | | | | | | | | | | | Before: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__(( unused)); After: bool aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa __attribute__((unused)); llvm-svn: 177034
* Update GCOVProfiling pass creation for API change in r177002. No ↵Nick Lewycky2013-03-142-11/+13
| | | | | | functionality change. llvm-svn: 177004
* Flag that friend function definitions are "late parsed" so thatJohn McCall2013-03-141-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template instantiation will still consider them to be definitions if we instantiate the containing class before we get around to parsing the friend. This seems like a legitimate use of "late template parsed" to me, but I'd appreciate it if someone responsible for the MS feature would look over this. This file already appears to access AST nodes directly, which is arguably not kosher in the parser, but the performance of this path matters enough that perpetuating the sin is justifiable. Probably we ought to reconsider this policy for very simple manipulations like this. The reason this entire thing is necessary is that function template instantiation plays some very gross games in order to not associate an instantiated function template with the class it came from unless it's a definition, and the reason *that's* necessary is that the AST currently cannot represent the instantiation history of individual function template declarations, but instead tracks it in common for the entire function template. That probably prevents us from correctly reporting ill-formed calls to ambiguously instantiated friend function templates. rdar://12350696 llvm-svn: 177003
* [modules] Don't write the UnusedFileScopedDecls vector to the module file.Argyrios Kyrtzidis2013-03-141-2/+3
| | | | llvm-svn: 177001
* [modules] Check for delegating constructor cycles when building a module and ↵Argyrios Kyrtzidis2013-03-142-9/+12
| | | | | | don't write them out to the module file. llvm-svn: 177000
* Avoid computing the linkage too early. Don't invalidate it.Rafael Espindola2013-03-146-81/+139
| | | | | | | | | | | | | | | | | | Before this patch we would compute the linkage lazily and cache it. When the AST was modified in ways that could change the value, we would invalidate the cache. That was fairly brittle, since any code could ask for the a linkage before the correct value was available. We should change the API to one where the linkage is computed explicitly and trying to get it when it is not available asserts. This patch is a first step in that direction. We still compute the linkage lazily, but instead of invalidating a cache, we assert that the AST modifications didn't change the result. llvm-svn: 176999
* Have these attriubtes set to 'true' or 'false'.Bill Wendling2013-03-131-52/+16
| | | | | | | | | The back-end cannot differentiate between functions that are from a .ll file and those generated from the front-end. We cannot then take the non-precense of these attributes as a "false" value. Have the front-end explicitly set the value to 'true' or 'false' depending upon what is actually set. llvm-svn: 176985
* [Modules] Don't eagerly load and associate all the module header files.Argyrios Kyrtzidis2013-03-134-26/+72
| | | | | | | | | | | | | | In a module-enabled Cocoa PCH file, we spend a lot of time stat'ing the headers in order to associate the FileEntries with their modules and support implicit module import. Use a more lazy scheme by enhancing HeaderInfoTable to store extra info about the module that a header belongs to, and associate it with its module only when there is a request for loading the header info for a particular file. Part of rdar://13391765 llvm-svn: 176976
* [Modules] Resolve top-headers of modules lazily.Argyrios Kyrtzidis2013-03-135-9/+23
| | | | | | | | | | | This allows resolving top-header filenames of modules to FileEntries when we need them, not eagerly. Note that that this breaks ABI for libclang functions clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders but this is fine because they are experimental and not widely used yet. llvm-svn: 176975
* Cause the mips16/nomips16 attribute to be passed to LLVM from ClangReed Kotler2013-03-131-4/+10
| | | | | | in the LLVM assembly language output. llvm-svn: 176971
* [analyzer] BugReporter - more precise tracking of C++ referencesAnna Zaks2013-03-131-23/+53
| | | | | | | | | | | | | | | | When BugReporter tracks C++ references involved in a null pointer violation, we want to differentiate between a null reference and a reference to a null pointer. In the first case, we want to track the region for the reference location; in the second, we want to track the null pointer. In addition, the core creates CXXTempObjectRegion to represent the location of the C++ reference, so teach FindLastStoreBRVisitor about it. This helps null pointer suppression to kick in. (Patch by Anna and Jordan.) llvm-svn: 176969
* Remove stray space.Ted Kremenek2013-03-131-1/+0
| | | | llvm-svn: 176966
* [analyzer] Handle Objc Fast enumeration for "loop is executed 0 times".Ted Kremenek2013-03-131-0/+7
| | | | | | Fixes <rdar://problem/12322528> llvm-svn: 176965
* Fix incorrect cast identification.Daniel Jasper2013-03-131-2/+6
| | | | | | Before: int a = sizeof(int *)+ b;" After: int a = sizeof(int *) + b; llvm-svn: 176957
* [analyzer] fixed the logic changed by r176949Anton Yartsev2013-03-131-4/+5
| | | | llvm-svn: 176956
* Fix comment indentation before labels.Daniel Jasper2013-03-131-0/+7
| | | | | | | | | | | | | | | | | | Before: switch (x) { // if 1, do f() case 1: f(); } After: switch (x) { // if 1, do f() case 1: f(); } llvm-svn: 176953
* Fix formatting issue with builder-type calls.Daniel Jasper2013-03-131-1/+1
| | | | | | | | | | | | Before: ->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() - aaaaaaaaa()->aaaaaa() ->aaaaa()); After: a->aaaaaa()->aaaaaaaaaaa(aaaaaaaa()->aaaaaa()->aaaaa() - aaaaaaaaa()->aaaaaa()->aaaaa()); llvm-svn: 176952
* Added AnnotatedToken::isOneOf + a few other refactoringsAlexander Kornienko2013-03-133-164/+155
| | | | | | | | | | | | | | Summary: <subj> Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D536 llvm-svn: 176951
* Refactoring:Anton Yartsev2013-03-131-34/+55
| | | | | | | | | + Individual Report* method for each bug type + Comment improved: missing non-trivial alloca() case annotated + 'range' parameter of ReportBadFree() capitalized + 'SymbolRef Sym = State->getSVal(A, C.getLocationContext()).getAsSymbol();' shorten to 'SymbolRef Sym = C.getSVal(A).getAsSymbol();' llvm-svn: 176949
* Reverting r176944 until Author fixes test failure.Edwin Vane2013-03-131-5/+2
| | | | llvm-svn: 176945
* ClangTool output cleanupEdwin Vane2013-03-131-2/+5
| | | | | | | | | | Information messages sent to stdout by ClangTool now only happen when the -debug flag is set. Error messages that used to go to stdout now go to stderr. Author: Ariel J Bernal <ariel.j.bernal@intel.com> llvm-svn: 176944
* Fix formatting of new arrays of pointers.Daniel Jasper2013-03-132-15/+20
| | | | | | | | | | | | | | Before: A = new SomeType * [Length]; A = new SomeType *[Length](); After: A = new SomeType *[Length]; A = new SomeType *[Length](); Small formatting cleanups with clang-format. llvm-svn: 176936
* Remove trailing comma in enum list.John McCall2013-03-131-1/+1
| | | | llvm-svn: 176926
* Tighten up the rules for precise lifetime and documentJohn McCall2013-03-138-27/+59
| | | | | | | | the requirements on the ARC optimizer. rdar://13407451 llvm-svn: 176924
* Objective-C: In my last path, also checkFariborz Jahanian2013-03-121-1/+2
| | | | | | | | for existence of user setter before issuing the warning about non-synthesizable property. // rdar://13388503 llvm-svn: 176906
* [driver] Only enable -fmodules-autolink if we are using the integrated ↵Ted Kremenek2013-03-121-10/+13
| | | | | | | | assembler. Fixes <rdar://problem/13289240> llvm-svn: 176897
* Whitespace cleanup.Rafael Espindola2013-03-122-5/+5
| | | | llvm-svn: 176896
* Force column info to be generated for call expressions so we canAdrian Prantl2013-03-123-15/+24
| | | | | | | | | differentiate multiple inlined call sites on the same line in the debug info. Fixes rdar://problem/13036237 llvm-svn: 176895
* Driver: -ccc-install-dir should affect cc1 -resource-dirJim Grosbach2013-03-121-9/+11
| | | | | | | | | | | | | | | -ccc-install-dir is supposed to cause the compiler to behave as-if it were installed in the indicated location. It almost does, but misses anything that's relying on the resource directory (libc++ header search, in particular). The resource dir is resolved too early, before command line args are handled. The fix is simply to move handling of the resource dir until after we know if a -ccc-install-dir is present. rdar://13402696 llvm-svn: 176894
* Objective-C: Issue warning in couple of obscure casesFariborz Jahanian2013-03-121-3/+21
| | | | | | | | | | when property autosynthesis does not synthesize a property. When property is declared 'readonly' in a super class and is redeclared 'readwrite' in a subclass. When a property autosynthesis causes it to share 'ivar' with another property. // rdar://13388503 llvm-svn: 176889
* Objective-C: Fixes a comment.Fariborz Jahanian2013-03-121-1/+1
| | | | llvm-svn: 176878
* Revert "Disallow using -fmodules with -no-integrated-as."Ted Kremenek2013-03-121-14/+2
| | | | | | | Per comment from Benjamin Kramer, this isn't portable (yet). I'll come up with a better fix. llvm-svn: 176876
* We already reported an error forRafael Espindola2013-03-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | extern "C" { void test5_f() { extern int test5_b; } } static float test5_b; This patch makes us report one for extern "C" { void test6_f() { extern int test6_b; } } extern "C" { static float test6_b; } Not because we think the declaration would be extern C, but because of the rule: An entity with C language linkage shall not be declared with the same name as an entity in global scope... We were just not looking past the extern "C" to see if the decl was in global scope. llvm-svn: 176875
* Implemented formatting of rvalue referencesAlexander Kornienko2013-03-121-12/+10
| | | | | | | | | | | | | | | | | | Summary: Handle "&&" usage as rvalue reference, added tests and fixed incorrect tests that interfere with this feature. http://llvm.org/bugs/show_bug.cgi?id=15051 Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D531 llvm-svn: 176874
* Correctly compute linkage of decls forward declared extern C.Rafael Espindola2013-03-121-2/+1
| | | | | | | | | | | | | | This fixes a crash in namespace { struct X {}; } extern "C" X test2_b; X test2_b before we would assign different linkages to each of the test2_b decls. llvm-svn: 176869
* Error if an extern C declaration matches a previous hidden extern C declaration.Rafael Espindola2013-03-121-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch we produce an error for extern "C" { void f() { extern int b; } } extern "C" { extern float b; } but not for extern "C" { void f() { extern int b; } } extern "C" { float b; } llvm-svn: 176867
* Remove a bogus assert so we don't crash inRafael Espindola2013-03-121-2/+0
| | | | | | | | | | | namespace { struct X {}; } extern "C" { X b = X(); } llvm-svn: 176866
* Remove bad space after "default".Daniel Jasper2013-03-121-1/+2
| | | | | | | | | | | | | | Before: switch (x) { default : {} } After: switch (x) { default: {} } llvm-svn: 176861
* Remove driver support for Hexagon V2 and V3Matthew Curtis2013-03-121-2/+0
| | | | | | | | | Driver will now error when trying to compile for V2 or V3. Removal of V2 and V3 support will allow us to simplify the hexagon back-end. llvm-svn: 176859
* Objective-C: When using super.prop, property should beFariborz Jahanian2013-03-111-2/+9
| | | | | | | looked up the current class's super class. // rdar://13349296 llvm-svn: 176832
* [analyzer] Look for calls along with lvalue nodes in trackNullOrUndefValue.Jordan Rose2013-03-111-9/+10
| | | | | | | | | | | | | | | | | | r176737 fixed bugreporter::trackNullOrUndefValue to find nodes for an lvalue even if the rvalue node had already been collected. This commit extends that to call statement nodes as well, so that if a call is contained within implicit casts we can still track the return value. No test case because node reclamation is extremely finicky (dependent on how the AST and CFG are built, and then on our current reclamation rules, and /then/ on how many nodes were generated by the analyzer core and the current set of checkers). I consider this a low-risk change, though, and it will only happen in cases of reclamation when the rvalue node isn't available. <rdar://problem/13340764> llvm-svn: 176829
* Disallow using -fmodules with -no-integrated-as.Ted Kremenek2013-03-111-2/+14
| | | | | | | | | | | | | Modules enables features such as auto-linking, and we simply do not want to support a matrix of subtly enabled/disabled features depending on whether or not a user is using the integrated assembler. It isn't clear if this is the best place to do this check. For one thing, these kind of errors are not caught by the serialized diagnostics. Fixes <rdar://problem/13289240> llvm-svn: 176826
* Improve the caching of debuginfo Objective C interface types.Adrian Prantl2013-03-112-27/+63
| | | | | | | | Generate forward declarations that are RAUW'd by finalize(). We thus avoid outputting the same type several times in multiple stages of completion. llvm-svn: 176820
* Add -Wc99-compat warning for C11 unicode string and character literals.Richard Smith2013-03-111-6/+8
| | | | llvm-svn: 176817
* PR15480: fixed second parameter types of vec_lde, vec_lvebx, vec_lvehx, and ↵Anton Yartsev2013-03-101-14/+14
| | | | | | vec_lvewx according to AltiVec Programming Interface Manual llvm-svn: 176789
OpenPOWER on IntegriCloud