summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
* follow-on to my patch: some targets (like sparc) do notChris Lattner2009-06-161-0/+2
| | | | | | | have target-specific builtins, and do not set the count. Just default to 0 for these targets. llvm-svn: 73510
* my refactoring of builtins changed target-specific builtins to only beChris Lattner2009-06-161-4/+5
| | | | | | | | | registered when PCH wasn't being used. We should always install (in BuiltinInfo) information about target-specific builtins, but we shouldn't register any builtin identifier infos. This fixes the build of apps that use PCH and target specific builtins together. llvm-svn: 73492
* Base SFINAE error suppression counting on the class of an error, notDouglas Gregor2009-06-151-1/+1
| | | | | | its (possibly-remapped) diagnostics. Thanks, Chris! llvm-svn: 73390
* Update LLVM.Douglas Gregor2009-06-141-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Implement support for C++ Substitution Failure Is Not An Error (SFINAE), which says that errors that occur during template argument deduction do *not* produce diagnostics and do not necessarily make a program ill-formed. Instead, template argument deduction silently fails. This is currently implemented for template argument deduction during matching of class template partial specializations, although the mechanism will also apply to template argument deduction for function templates. The scheme is simple: - If we are in a template argument deduction context, any diagnostic that is considered a SFINAE error (or warning) will be suppressed. The error will be propagated up the call stack via the normal means. - By default, all warnings and errors are SFINAE errors. Add the NoSFINAE class to a diagnostic in the .td file to make it a hard error (e.g., for access-control violations). Note that, to make this fully work, every place in Sema that emits an error *and then immediately recovers* will need to check Sema::isSFINAEContext() to determine whether it must immediately return an error rather than recovering. llvm-svn: 73332
* Sink the BuiltinInfo object from ASTContext into theChris Lattner2009-06-141-6/+4
| | | | | | | | preprocessor and initialize it early in clang-cc. This ensures that __has_builtin works in all modes, not just when ASTContext is around. llvm-svn: 73319
* move the various builtins stuff from libast to libbasic. ThisChris Lattner2009-06-143-5/+99
| | | | | | fixes a layering violation in lib/Basic/Targets.cpp. llvm-svn: 73318
* Add stack alignment to x86_64 target data.Daniel Dunbar2009-06-081-1/+1
| | | | | | | - <rdar://problem/6948443> WARNING: Linking two modules of different data layouts! llvm-svn: 73093
* Minor tweaks to the Windows target.Eli Friedman2009-06-081-0/+4
| | | | llvm-svn: 73083
* PR4346: add "R" asm register constraint.Eli Friedman2009-06-081-0/+1
| | | | llvm-svn: 73081
* Misc minor fixes for clang for the Windows target.Eli Friedman2009-06-081-3/+12
| | | | llvm-svn: 73050
* Remove dead code: 'NewEntry' is not used.Zhongxing Xu2009-06-071-3/+0
| | | | llvm-svn: 73027
* Move CharIsSigned from TargetInfo to LangOptions.Eli Friedman2009-06-052-4/+9
| | | | llvm-svn: 72928
* Move a couple Darwin-specific defines into getDarwinDefines.Eli Friedman2009-06-041-0/+5
| | | | llvm-svn: 72900
* Back out r72764; I should have looked more carefully before committing Eli Friedman2009-06-031-7/+0
| | | | | | this. The correct replacement for "Y" and "Yt" is "x". llvm-svn: 72765
* PR3678: Add support for "Yt" asm register constraint.Eli Friedman2009-06-031-0/+7
| | | | llvm-svn: 72764
* Add floating point details to PIC16 Target.Sanjiv Gupta2009-06-021-1/+11
| | | | llvm-svn: 72713
* Add a couple missing ARM defines.Eli Friedman2009-05-291-0/+2
| | | | llvm-svn: 72583
* A few more tweaks for Solaris; please correct me if it's wrong somehow.Eli Friedman2009-05-221-7/+10
| | | | llvm-svn: 72240
* Improve target support for Solaris.Douglas Gregor2009-05-211-4/+42
| | | | llvm-svn: 72237
* Avoid potential out-of-bounds access in SourceManager::getLineNumber.Daniel Dunbar2009-05-181-1/+13
| | | | | | - Chris, please see added FIXMEs. llvm-svn: 72019
* Targets without long long should reduce the size of intmax_t Eli Friedman2009-05-161-0/+2
| | | | | | accordingly. llvm-svn: 71966
* Provide dummy va_list typedef for msp430Anton Korobeynikov2009-05-081-1/+1
| | | | llvm-svn: 71233
* Handle -march for the LLVM recognized cpu names.Daniel Dunbar2009-05-061-10/+35
| | | | | | | - x86 target feature handling should not be feature complete, even if the code quality is lacking. llvm-svn: 71123
* More x86 target feature support.Daniel Dunbar2009-05-061-4/+58
| | | | | | | | | | | | | | | | | | - Apologies for the extremely gross code duplication, I want to get this working and then decide how to get this information out of the back end. - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc doesn't distinguish them? - -msse, etc. now properly disable/enable related features. - Don't always define __SSE3__... - The main missing functionality bit here is that we don't initialize the features based on the CPU for all -march options. llvm-svn: 71117
* Tweak x86 -mcpu defaults.Daniel Dunbar2009-05-061-0/+3
| | | | | | | | | - Default to yonah on Darwin (to get SSE3). - Default to Pentium4 (32-bit) and x86-64 (64-bit) on non-Darwin. Welcome to the 21st century. llvm-svn: 71069
* Fix rdar://6860124 - invalid input constraint 'J' in asmChris Lattner2009-05-061-1/+9
| | | | | | | This recognizes all the target-independent constant constraints that have target-specific meanings. llvm-svn: 71064
* Improve handling of (X86) target features.Daniel Dunbar2009-05-061-45/+52
| | | | | | | | | | | | | | | | | | | | | - This is a WIP... - This adds -march= handling to the driver, and fixes the defaulting of -mcpu on Darwin (which was using the wrong test). Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as -target-feature [+-]name In clang-cc, communicate with the (clang) target to discover the legal features of a target, and the features which are enabled based on -mcpu. This is currently hardcoded just enough to not be a feature regression, we need to get this information from the backend's TableGen information somehow. This is used to construct the full list of features which are being used, which is in turn used to initialize the predefines. llvm-svn: 71061
* Hook msp430 inAnton Korobeynikov2009-05-031-0/+73
| | | | llvm-svn: 70774
* Whitespace cleanupAnton Korobeynikov2009-05-031-139/+138
| | | | llvm-svn: 70773
* when creating custom warning diagnostics, do not attempt to mapChris Lattner2009-05-021-5/+0
| | | | | | | | them with -Werror. Custom diags cannot be mapped, and this makes -Werror cause a determinstic crash for the checker and other clients of the custom diagnostics machinery. rdar://6816191 llvm-svn: 70639
* Simplify the scheme used for keywords, and change the classification Eli Friedman2009-04-281-55/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scheme to be more useful. The new scheme introduces a set of categories that should be more readable, and also reflects what we want to consider as an extension more accurately. Specifically, it makes the "what is a keyword" determination accurately reflect whether the keyword is a GNU or Microsoft extension. I also introduced separate flags for keyword aliases; this is useful because the classification of the aliases is mostly unrelated to the classification of the original keyword. This patch treats anything that's in the implementation namespace (prefixed with "__", or "_X" where "X" is any upper-case letter) as a keyword without marking it as an extension. This is consistent with the standards in that an implementation is allowed to define arbitrary extensions in the implementation namespace without violating the standard. This gets rid of all the nasty "extension used" warnings for stuff like __attribute__ in -pedantic mode. We still warn for extensions outside of the the implementation namespace, like typeof. If someone wants to implement -Wextensions or something like that, we could add additional information to the keyword table. This also removes processing for the unused "Boolean" language option; such an extension isn't supported on any other C implementation, so I don't see any point to adding it. The changes to test/CodeGen/inline.c are required because previously, we weren't actually disabling the "inline" keyword in -std=c89 mode. I'll remove Boolean and NoExtensions from LangOptions in a follow-up commit. llvm-svn: 70281
* Be more careful in our teardown of the PCHReader after deciding toDouglas Gregor2009-04-271-0/+16
| | | | | | ignore a PCH file. llvm-svn: 70251
* Implement caching of stat() calls for precompiled headers, which isDouglas Gregor2009-04-271-0/+18
| | | | | | | | essentially the same thing we do with pretokenized headers. stat() caching improves performance of the Cocoa-prefixed "Hello, World" by 45%. llvm-svn: 70223
* Load most of the source manager's information lazily from the PCHDouglas Gregor2009-04-271-4/+52
| | | | | | | | | | | | | | | | | | | file. In particular, only eagerly load source location entries for files and for the predefines buffer. Other buffers and macro-instantiation source location entries are loaded lazily. With the Cocoa-prefixed "Hello, World", we only load 815/26555 source location entities. This halves the amount of user time we spend in this "Hello, World" program with -fsyntax-only (down to .007s). This optimization is part 1 of 2 for the source manager. This eliminates most of the user time in loading a PCH file. We still spend too much time initialize File structures (especially in the calls to stat), so we need to either make the loading of source location entries for files lazy or import the stat cache from the PTH implementation. llvm-svn: 70196
* Some fixes for PCH (de-)serialization of Objective-C AST nodes:Douglas Gregor2009-04-261-2/+5
| | | | | | | | | | | | | | | | - Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr - Implement PCH support for ImplicitParamDecl - Fix the handling of the body of an ObjCMethodDecl - Several cast -> cast_or_null fixes - Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL selectors. - Make Selector::getAsString() work with NULL selectors. - Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt in the PCH reader and writer; these were never getting called. At this point, all of the pch-test tests pass for C and Objective-C. llvm-svn: 70163
* in a tied operand, don't copy over the name or constraint string, just the ↵Chris Lattner2009-04-261-2/+1
| | | | | | flags. llvm-svn: 70137
* pull operands names "[foo]" into ConstraintInfo.Chris Lattner2009-04-261-13/+7
| | | | llvm-svn: 70136
* pull the constraint string into the ConstraintInfo structChris Lattner2009-04-261-4/+5
| | | | | | instead of passing it around in addition to it. llvm-svn: 70135
* change TargetInfo::ConstraintInfo to be a struct that containsChris Lattner2009-04-262-29/+23
| | | | | | the enum along with some other data. llvm-svn: 70114
* Lazily load the controlling macros for all of the headers known in theDouglas Gregor2009-04-251-0/+2
| | | | | | | | PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes us from reading 503 identifiers down to 37 and from 470 macros down to 4. It also results in an 8% performance improvement. llvm-svn: 70094
* some arm triples have weird characters in them, just fuzzy matchChris Lattner2009-04-231-7/+11
| | | | | | on armv* to be more compatible llvm-svn: 69864
* Remove the serialization code that predates precompiledDouglas Gregor2009-04-226-377/+1
| | | | | | | headers. Future approaches to (de-)serializing ASTs will be based on the PCH infrastructure. llvm-svn: 69828
* Add missing dependency, patch by Jason Haslam!Chris Lattner2009-04-221-0/+1
| | | | llvm-svn: 69819
* Pass and return aggregate types directly to function calls.Sanjiv Gupta2009-04-211-1/+1
| | | | llvm-svn: 69668
* Don't crash in the diagnostic printer if we happen to get passed aDaniel Dunbar2009-04-201-0/+13
| | | | | | null string / identifier. llvm-svn: 69575
* move group twiddling options into Diagnostic.cpp instead ofChris Lattner2009-04-191-0/+58
| | | | | | | Warnings.cpp. Warnings.cpp now doesn't need to #include tblgen produced output directly. llvm-svn: 69559
* Add target property for whether thread-local storage is supported. Eli Friedman2009-04-192-3/+10
| | | | | | | | Let me know if I messed up for some target. Note that for Windows, we should be able to support it (MSVC supports "__declspec(thread)"), but I'm pretty sure LLVM doesn't know how to generate the correct code. llvm-svn: 69552
* actually just do this on all x86 targets, it won't hurtChris Lattner2009-04-191-10/+5
| | | | | | non-glibc ones. llvm-svn: 69528
* Define __NO_MATH_INLINES on linux/x86 so that we don't get inlineChris Lattner2009-04-191-0/+10
| | | | | | | | | | functions in glibc header files that use FP Stack inline asm which the backend can't deal with (PR879). This "fixes" PR3970 for linux. Other affected systems should do similar things. Maybe this should just go to the general i386/x86-64 sections? llvm-svn: 69527
* optimize and comment GetDiagInfo.Chris Lattner2009-04-161-6/+32
| | | | llvm-svn: 69273
OpenPOWER on IntegriCloud