summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix a typo that breaks the GCC build. Turns out that Clang isn'tDouglas Gregor2010-06-091-1/+1
| | | | | | | diagnosing this code as an error when it should, so I've filed http://llvm.org/bugs/show_bug.cgi?id=7325. llvm-svn: 105683
* Added FixIt support to printf format string checking.Tom Care2010-06-092-38/+255
| | | | | | | | | | | | | | | | - Refactored LengthModifier to be a class. - Added toString methods in all member classes of FormatSpecifier. - FixIt suggestions keep user specified flags unless incorrect. Limitations: - The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation. A test/Sema/format-strings-fixit.c M include/clang/Analysis/Analyses/PrintfFormatString.h M lib/Analysis/PrintfFormatString.cpp M lib/Sema/SemaChecking.cpp llvm-svn: 105680
* Tweak our handling of the notion of a standard conversion sequenceDouglas Gregor2010-06-095-45/+56
| | | | | | | | | | | | | being a subsequence of another standard conversion sequence. Instead of requiring exact type equality for the second conversion step, require type *similarity*, which is type equality with cv-qualifiers removed at all levels. This appears to match the behavior of EDG and VC++ (albeit not GCC), and feels more intuitive. Big thanks to John for the line of reasoning that supports this change: since cv-qualifiers are orthogonal to the second conversion step, we should ignore them in the type comparison. llvm-svn: 105678
* Simplify the code a bit and avoid a gcc waring about uninitialized variables.Rafael Espindola2010-06-091-29/+24
| | | | llvm-svn: 105676
* Get rid of getMangledCXXCtorName and getMangledCXXDtorName.Anders Carlsson2010-06-093-24/+8
| | | | llvm-svn: 105673
* More mangling cleanup.Anders Carlsson2010-06-091-6/+8
| | | | llvm-svn: 105672
* Get rid of an unnecessary getMangledName overload.Anders Carlsson2010-06-092-13/+1
| | | | llvm-svn: 105671
* Fix a gcc warning.Rafael Espindola2010-06-091-1/+1
| | | | llvm-svn: 105670
* Implement transpose/zip/unzip & table lookup.Nate Begeman2010-06-093-7/+107
| | | | | | Test out some basic constant-checking. llvm-svn: 105667
* Fix memory leak in ASTContext where ASTRecordLayout objects involving C++ ↵Ted Kremenek2010-06-081-7/+10
| | | | | | | | | structures wouldn't have their associated memory destroyed when using a BumpPtrAllocator. These objects internally use a DenseMap. llvm-svn: 105659
* Fix memory leak in Preprocessor where MacroInfo objects in the MICache ↵Ted Kremenek2010-06-081-0/+8
| | | | | | | | wouldn't have their associated SmallVectors get deallocated. llvm-svn: 105658
* Code cleanup: remove explicit flush() in favor of using the ostream's str()Jordy Rose2010-06-081-2/+1
| | | | llvm-svn: 105657
* On Darwin, initialization and destruction functions should go into the ↵Anders Carlsson2010-06-082-0/+11
| | | | | | __StaticInit section. llvm-svn: 105650
* Add a global CreateGlobalInitOrDestructFunction and use it for creating ↵Anders Carlsson2010-06-081-11/+17
| | | | | | global init or destruction functions. llvm-svn: 105649
* Rename __tcf_ to __cxx_global_array_dtor. Remove the ↵Anders Carlsson2010-06-083-6/+3
| | | | | | UniqueAggreDestructorCount from CodeGenFunction and let LLVM handle uniquing the internal functions instead. llvm-svn: 105648
* Move GenerateCXXAggrDestructorHelper to CGDeclCXX.cpp where it belongs.Anders Carlsson2010-06-082-38/+37
| | | | llvm-svn: 105647
* Simplify GenerateCXXAggrDestructorHelper.Anders Carlsson2010-06-083-27/+19
| | | | llvm-svn: 105646
* When referring to a tag that was previously declared only as a friend, Douglas Gregor2010-06-081-1/+2
| | | | | | | build a new declaration for that tag type that will be visible for future lookups of that tag. llvm-svn: 105643
* A built-in overload candidate is consider a non-template function whenDouglas Gregor2010-06-081-1/+1
| | | | | | | determining whether one overload candidate is better than another. Fixes PR7319. llvm-svn: 105642
* Block Code Gen. API. Call destructor on descriptiorFariborz Jahanian2010-06-081-2/+30
| | | | | | entry previously constructed via copy constructor. llvm-svn: 105641
* Simplify libIndex Makefile, which doesn't need to worry about altivec support.Daniel Dunbar2010-06-081-6/+0
| | | | llvm-svn: 105639
* Makefiles: Set Clang CPP compiler flags in a single location, instead of ↵Daniel Dunbar2010-06-0812-30/+0
| | | | | | scattered throughout the project Makefiles. llvm-svn: 105638
* Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.Daniel Dunbar2010-06-0815-33/+33
| | | | | | - This eliminates most dependencies on how Clang is installed relative to LLVM. llvm-svn: 105637
* Warn about comparisons between arrays and improve self-comparisonDouglas Gregor2010-06-081-11/+45
| | | | | | warnings, from Troy Straszheim! Fixes PR6163. llvm-svn: 105631
* Correctly handle fields with virtual bases containing empty subobjects.Anders Carlsson2010-06-081-1/+27
| | | | llvm-svn: 105628
* Fixes a typo which prevented proper code gen. forFariborz Jahanian2010-06-081-2/+1
| | | | | | copy-in of c++ class objects into blocks. llvm-svn: 105622
* Implement a warning when converting the literal 'false' to aDouglas Gregor2010-06-081-1/+7
| | | | | | pointer. Original patch by Troy D. Straszheim; fixes PR7283. llvm-svn: 105621
* When checking whether we can place a base subobject at an offset, we don't ↵Anders Carlsson2010-06-081-1/+22
| | | | | | need to go past the highest offset that's known to contain an empty base subobject. llvm-svn: 105611
* Minor cleanups to the empty subobject map.Anders Carlsson2010-06-081-8/+23
| | | | llvm-svn: 105608
* Correctly mangle static variables of anonymous struct/union type.Anders Carlsson2010-06-081-0/+44
| | | | llvm-svn: 105606
* Add a checker check if a global variable holds a local variable's address afterZhongxing Xu2010-06-084-0/+97
| | | | | | the function call is left where the local variable is declared. llvm-svn: 105602
* Fix NEON intrinsic argument passing, support vext. Most now successfully ↵Nate Begeman2010-06-082-57/+87
| | | | | | make it through codegen to the .s file llvm-svn: 105599
* Implement -fcaret-diagnostics to undo -fno-caret-diagnostics.Jeffrey Yasskin2010-06-081-1/+5
| | | | llvm-svn: 105597
* Fix what looks like a merge problem that broke __clear_cache.Rafael Espindola2010-06-081-1/+1
| | | | llvm-svn: 105595
* Since the enum values for each arch's builtins overlap, it is not ↵Nate Begeman2010-06-082-4/+36
| | | | | | appropriate to check them when compiling or other archs. Fixes a problem where compiling for NEON would use x86 sema rules. llvm-svn: 105593
* Fix passing and returning of objects with non trivial copy constructors onRafael Espindola2010-06-081-0/+10
| | | | | | | | ARM. Fixes PR7310. llvm-svn: 105592
* Implement ARM NEON up through vcvt, alphabetically.Nate Begeman2010-06-082-30/+89
| | | | llvm-svn: 105590
* Extend __builtin_shufflevector to expose the full power of the llvm ↵Nate Begeman2010-06-082-31/+133
| | | | | | shufflevector instruction. This means it can now be used for vector truncation and concatenation. This will be used for the ARM NEON implementation. llvm-svn: 105589
* Driver: Support invoking Clang on .ll or .bc inputs.Daniel Dunbar2010-06-073-13/+39
| | | | | | | | | | | | | | | - We actually pretend that we have two separate types for LLVM assembly/bitcode because we need to use the standard suffixes with LTO ('clang -O4 -c t.c' should generate 't.o'). It is now possible to do something like: $ clang -emit-llvm -S t.c -o t.ll ... assorted other compile flags ... $ clang -c t.ll -o t.o ... assorted other compile flags ... and expect that the output will be almost* identical to: $ clang -c t.c -o t.o ... assorted other compile flags ... because all the target settings (default CPU, target features, etc.) will all be initialized properly by the driver/frontend. *: This isn't perfect yet, because in practice we will end up running the optimization passes twice. It's possible to get something equivalent out with a well placed -mllvm -disable-llvm-optzns, but I'm still thinking about the cleanest way to solve this problem more generally. llvm-svn: 105584
* Frontend: Add CodeGenAction support for handling LLVM IR.Daniel Dunbar2010-06-071-14/+74
| | | | | | | | | | | | | | | | | - This magically enables using 'clang -cc1' as a replacement for most of 'llvm-as', 'llvm-dis', 'llc' and 'opt' functionality. For example, 'llvm-as' is: $ clang -cc1 -emit-llvm-bc FOO.ll -o FOO.bc and 'llvm-dis' is: $ clang -cc1 -emit-llvm FOO.bc -o - and 'opt' is, e.g.: $ clang -cc1 -emit-llvm -O3 -o FOO.opt.ll FOO.ll and 'llc' is, e.g.: $ clang -cc1 -S -o - FOO.ll The nice thing about using the backend tools this way is that they are guaranteed to exactly match how the compiler generates code (for example, setting the same backend options). llvm-svn: 105583
* Frontend: Add FrontendAction support for handling LLVM IR inputs.Daniel Dunbar2010-06-074-2/+25
| | | | | | - These inputs follow an abbreviated execution path, but are still worth handling by FrontendAction so they reuse all the other clang -cc1 features. llvm-svn: 105582
* FrontendAction: Track active file kind.Daniel Dunbar2010-06-072-6/+9
| | | | llvm-svn: 105581
* Frontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.Daniel Dunbar2010-06-072-3/+4
| | | | llvm-svn: 105580
* Frontend: Move some initialization from CompilerInstance to FrontendAction, ↵Daniel Dunbar2010-06-073-25/+12
| | | | | | to parallel what is done for AST inputs. llvm-svn: 105579
* Frontend: Change FrontendAction::BeginSourceFile to take the input kind ↵Daniel Dunbar2010-06-073-3/+4
| | | | | | instead of an IsAST bool. llvm-svn: 105578
* Frontend: Lift InputKind enumeration to top level.Daniel Dunbar2010-06-074-64/+61
| | | | llvm-svn: 105577
* Frontend: Drop unnecessary TargetData argument to EmitBackendOutput, we alwaysDaniel Dunbar2010-06-072-21/+11
| | | | | | create modules which have target data strings. llvm-svn: 105576
* Frontend: Factor clang::EmitBackendOutput out of CodeGenAction.Daniel Dunbar2010-06-073-327/+359
| | | | llvm-svn: 105575
* Frontend: Add CodeGenOptions::SimplifyLibCalls, and eliminate LangOptions ↵Daniel Dunbar2010-06-072-5/+5
| | | | | | argument to BackendConsumer. llvm-svn: 105574
* When using property-dot assignment syntax to call a setter method,Fariborz Jahanian2010-06-072-4/+17
| | | | | | | type of rhs need be compared to setter's argument and not the getter type. Fixes radar 8062778 llvm-svn: 105560
OpenPOWER on IntegriCloud