summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Implement C++0x [expr.static.cast]p9, which permits explicitly castingDouglas Gregor2011-02-181-10/+15
| | | | | | | | | | a scoped enumeration type to an integral or floating type, properly. There was an over-eager assertion, and it was missing the floating-point case. Fixes PR9107/<rdar://problem/8937402>. llvm-svn: 125825
* The flags we're supposed to write into a byref struct are *not* theJohn McCall2011-02-181-12/+13
| | | | | | | | | | | | _Block_object_* flags; it's just BLOCK_HAS_COPY_DISPOSE or not. Also, we don't need to chase forwarding pointers prior to calling _Block_object_dispose; _Block_object_dispose in fact already does this. rdar://problem/9006315 llvm-svn: 125823
* When building a qualified reference to a member of an anonymous structDouglas Gregor2011-02-181-6/+7
| | | | | | | | | or union, place the qualifier on the outermost member reference expression, which actually contains the entity name. Fixes PR9188/<rdar://problem/8990184>. llvm-svn: 125822
* Fix assertion failure on -Warray-bounds for 32-bit builds of Clang.Ted Kremenek2011-02-181-1/+4
| | | | llvm-svn: 125821
* Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenActionPeter Collingbourne2011-02-182-17/+28
| | | | | | | | | This removes the final dependency edge from any lib outside of CodeGen to core. As a result we can, and do, trim the dependency on core from libclang, PrintFunctionNames, the unit tests and c-index-test. While at it, review and trim other unneeded dependencies. llvm-svn: 125820
* Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfoPeter Collingbourne2011-02-184-16/+36
| | | | llvm-svn: 125819
* When we're creating an expression for an integral template argument ofDouglas Gregor2011-02-181-2/+9
| | | | | | | | | | | | | enumeration type, we were generating an integer literal implicitly casted to the appropriate enumeration type. However, later checks on that expression would strip the implicit cast. This commit tweaks the lame hack, by creating an explicit cast instead of an implicit cast. The right answer is to introduce a SubstNonTypeTemplateParmExpr expression that acts like the substituted result. I'll investigate that soon. llvm-svn: 125818
* implement basic support for __label__. I wouldn't be shocked if there areChris Lattner2011-02-184-9/+49
| | | | | | | | | bugs from other clients that don't expect to see a LabelDecl in a DeclStmt, but if so they should be easy to fix. This implements most of PR3429 and rdar://8287027 llvm-svn: 125817
* Switch labels over to using normal name lookup, instead of their Chris Lattner2011-02-188-127/+65
| | | | | | | own weird little DenseMap. Hey look, we now emit unused label warnings deterministically, amazing. llvm-svn: 125813
* handle labeldecls.Chris Lattner2011-02-181-1/+6
| | | | llvm-svn: 125806
* make block bodies handle undefined labels just like functions.Chris Lattner2011-02-171-7/+4
| | | | llvm-svn: 125799
* improve support for big endian targets, fixing PR8171, patchChris Lattner2011-02-172-3/+16
| | | | | | by Heikki Kultala! llvm-svn: 125784
* CMake: updated source file list.Oscar Fuentes2011-02-171-0/+1
| | | | llvm-svn: 125783
* [analyzer] Use the new registration mechanism for the debugging info "checks".Argyrios Kyrtzidis2011-02-173-19/+96
| | | | | | | | | | The relative checker package is 'debug': '-dump-live-variables' is replaced by '-analyzer-checker=debug.DumpLiveVars' '-cfg-view' is replaced by '-analyzer-checker=debug.ViewCFG' '-cfg-dump' is replaced by '-analyzer-checker=debug.DumpCFG' llvm-svn: 125780
* [analyzer] Use the new registration mechanism on the ↵Argyrios Kyrtzidis2011-02-179-75/+162
| | | | | | | | | | | | | non-path-sensitive-checkers: DeadStoresChecker ObjCMethSigsChecker ObjCUnusedIvarsChecker SizeofPointerChecker ObjCDeallocChecker SecuritySyntaxChecker llvm-svn: 125779
* [analyzer]Argyrios Kyrtzidis2011-02-174-42/+101
| | | | | | | | | | -Introduce CheckerV2, a set of templates for convenient declaration & registration of checkers. Currently useful just for checkers working on the AST not the path-sensitive ones. -Enhance CheckerManager to actually collect the checkers and turn it into the entry point for running the checkers. -Use the new mechanism for the LLVMConventionsChecker. llvm-svn: 125778
* [analyzer] Pass CheckerManager to the registration functions.Argyrios Kyrtzidis2011-02-1719-24/+121
| | | | llvm-svn: 125777
* Enhance the array bounds checking to work for several other constructs,Chandler Carruth2011-02-172-10/+18
| | | | | | | | | especially C++ code, and generally expand the test coverage. Logic adapted from a patch by Kaelyn Uhrain <rikka@google.com> and another Googler. llvm-svn: 125775
* Clean up the style of this function to match the conventions in the restChandler Carruth2011-02-171-28/+27
| | | | | | of Clang, and reflows the code a bit to make it easier to read. llvm-svn: 125773
* add a fixmeChris Lattner2011-02-171-0/+2
| | | | llvm-svn: 125772
* Step #2/N of __label__ support: keep pushing LabelDecl forward,Chris Lattner2011-02-1711-67/+107
| | | | | | | | | | making them be template instantiated in a more normal way and make them handle attributes like other decls. This fixes the used/unused label handling stuff, making it use the same infrastructure as other decls. llvm-svn: 125771
* Inline LocalInstantiationScope::getInstantiationOf into its oneChris Lattner2011-02-172-12/+10
| | | | | | client, making room for future hacking. llvm-svn: 125770
* remove some defensive code: LocalInstantiationScope::getInstantiationOfChris Lattner2011-02-172-7/+4
| | | | | | and findInstantiationOf can never return null, even on invalid code. llvm-svn: 125769
* Eliminate the internal command-line option for viewing inheritance in C++ ↵Douglas Gregor2011-02-174-42/+1
| | | | | | classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful llvm-svn: 125762
* Remove the "conditional save" hashtables from IR generation.John McCall2011-02-174-23/+1
| | | | llvm-svn: 125761
* The internal -fdump-record-layouts flag already dumps the layout when it was ↵Douglas Gregor2011-02-171-24/+0
| | | | | | computed; no need to do so again at the end of the translation unit llvm-svn: 125760
* When building StaticAnalyzer/Frontend add -I "<Checkers build dir>" to allow ↵Argyrios Kyrtzidis2011-02-173-1/+5
| | | | | | | | | | Checkers.inc to be included without '..', thus being compatible with build systems of *BSDs. Patch by Joerg Sonnenberger! llvm-svn: 125758
* Remove the last virtual member function from the Decl hierarchy,Douglas Gregor2011-02-171-3/+0
| | | | | | | | reducing the size of all declarations by one pointer. For a 64-bit Clang parsing Cocoa.h, this saves ~630k of memory (about 3.5% of ASTContext's memory usage for this header). llvm-svn: 125756
* Devirtualize TagDecl::completeDefinition().Douglas Gregor2011-02-172-14/+15
| | | | llvm-svn: 125755
* Devirtualize DeclaratorDecl::getInnerLocStart() and TagDecl::getInnerLocStart().Douglas Gregor2011-02-172-14/+25
| | | | llvm-svn: 125754
* Improve diagnostics on missing property decl.Fariborz Jahanian2011-02-171-1/+1
| | | | llvm-svn: 125752
* Devirtualize NamedDecl::getNameForDiagnostic().Douglas Gregor2011-02-172-26/+24
| | | | llvm-svn: 125751
* Devirtualize RedeclarableTemplateDecl::newCommon().Douglas Gregor2011-02-171-0/+8
| | | | llvm-svn: 125750
* Implement a sub-group of -Wconversion: -Wliteral-conversion. ThisChandler Carruth2011-02-171-3/+9
| | | | | | | | | | | specifically targets literals which are implicitly converted, a those are more often unintended and trivial to fix. This can be especially helpful for diagnosing what makes 'const int x = 1e6' not an ICE. Original patch authored by Jim Meehan with contributions from other Googlers and a few cleanups from myself. llvm-svn: 125745
* Change the representation of GNU ?: expressions to use a different expressionJohn McCall2011-02-1729-288/+659
| | | | | | | | | | | | | | | | | | | | | | class and to bind the shared value using OpaqueValueExpr. This fixes an unnoticed problem with deserialization of these expressions where the deserialized form would lose the vital pointer-equality trait; or rather, it fixes it because this patch also does the right thing for deserializing OVEs. Change OVEs to not be a "temporary object" in the sense that copy elision is permitted. This new representation is not totally unawkward to work with, but I think that's really part and parcel with the semantics we're modelling here. In particular, it's much easier to fix things like the copy elision bug and to make the CFG look right. I've tried to update the analyzer to deal with this in at least some obvious cases, and I think we get a much better CFG out, but the printing of OpaqueValueExprs probably needs some work. llvm-svn: 125744
* lib/Frontend/InitHeaderSearch.cpp: Add mingw-w64's include paths.NAKAMURA Takumi2011-02-171-0/+8
| | | | llvm-svn: 125743
* Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.NAKAMURA Takumi2011-02-176-16/+4
| | | | | | No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. llvm-svn: 125742
* Fix whitespace.NAKAMURA Takumi2011-02-174-20/+19
| | | | llvm-svn: 125741
* Devirtualize Decl::getNextRedeclaration().Douglas Gregor2011-02-171-0/+72
| | | | llvm-svn: 125740
* Implement -Wenum-compare, which warns when comparing two enums ofChandler Carruth2011-02-171-2/+18
| | | | | | | | | | | different types. We omit the warning when the enum types are anonymous. Unlike GCC, this warning does not distinguish between C++ and C/ObjC for controling whether it is on by default, it is always on by default. Original patch contributed by Richard Trieu (@ Google), I fixed some style issues, and cleaned it up for submission. llvm-svn: 125739
* Simple little optimization to Decl::getCanonicalDecl(), eliminating some ↵Douglas Gregor2011-02-171-4/+4
| | | | | | heavyweight machinery and indirection that we don't need llvm-svn: 125737
* Devirtualize Decl::getSourceRange()Douglas Gregor2011-02-171-1/+25
| | | | llvm-svn: 125736
* Devirtualize Decl::getCanonicalDecl().Douglas Gregor2011-02-171-0/+23
| | | | llvm-svn: 125735
* Step #1/N of implementing support for __label__: split labels intoChris Lattner2011-02-1722-269/+200
| | | | | | | | | | | | | | | | | | | LabelDecl and LabelStmt. There is a 1-1 correspondence between the two, but this simplifies a bunch of code by itself. This is because labels are the only place where we previously had references to random other statements, causing grief for AST serialization and other stuff. This does cause one regression (attr(unused) doesn't silence unused label warnings) which I'll address next. This does fix some minor bugs: 1. "The only valid attribute " diagnostic was capitalized. 2. Various diagnostics printed as ''labelname'' instead of 'labelname' 3. This reduces duplication of label checking between functions and blocks. Review appreciated, particularly for the cindex and template bits. llvm-svn: 125733
* Devirtualize Decl::getBody() and Decl::hasBody().Douglas Gregor2011-02-171-0/+18
| | | | llvm-svn: 125731
* De-virtualize Decl::isOutOfLine().Douglas Gregor2011-02-172-2/+11
| | | | llvm-svn: 125730
* When printing a qualified type, look through a substituted templateDouglas Gregor2011-02-171-5/+55
| | | | | | | | | | parameter type to see what's behind it, so that we don't end up printing silly things like "float const *" when "const float *" would make more sense. Also, replace the pile of "isa" tests with a simple switch enumerating all of the cases, making a few more obvious cases use prefix qualifiers. llvm-svn: 125729
* simplify a bit.Chris Lattner2011-02-172-4/+2
| | | | llvm-svn: 125724
* Improve parser recovery in "for" statements, from Richard Smith!Douglas Gregor2011-02-171-7/+18
| | | | llvm-svn: 125722
* I will not hold on to temporary StringRefs.Douglas Gregor2011-02-171-50/+51
| | | | | | | | | | | | | | | I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. I will not hold on to temporary StringRefs. llvm-svn: 125718
OpenPOWER on IntegriCloud