summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement a new 'availability' attribute, that allows one to specifyDouglas Gregor2011-03-2321-85/+643
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which versions of an OS provide a certain facility. For example, void foo() __attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6))); says that the function "foo" was introduced in 10.2, deprecated in 10.4, and completely obsoleted in 10.6. This attribute ties in with the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that we want to deploy back to Mac OS X 10.1). There are several concrete behaviors that this attribute enables, as illustrated with the function foo() above: - If we choose a deployment target >= Mac OS X 10.4, uses of "foo" will result in a deprecation warning, as if we had placed attribute((deprecated)) on it (but with a better diagnostic) - If we choose a deployment target >= Mac OS X 10.6, uses of "foo" will result in an "unavailable" warning (in C)/error (in C++), as if we had placed attribute((unavailable)) on it - If we choose a deployment target prior to 10.2, foo() is weak-imported (if it is a kind of entity that can be weak imported), as if we had placed the weak_import attribute on it. Naturally, there can be multiple availability attributes on a declaration, for different platforms; only the current platform matters when checking availability attributes. The only platforms this attribute currently works for are "ios" and "macosx", since we already have -mxxxx-version-min flags for them and we have experience there with macro tricks translating down to the deprecated/unavailable/weak_import attributes. The end goal is to open this up to other platforms, and even extension to other "platforms" that are really libraries (say, through a #pragma clang define_system), but that hasn't yet been designed and we may want to shake out more issues with this narrower problem first. Addresses <rdar://problem/6690412>. As a drive-by bug-fix, if an entity is both deprecated and unavailable, we only emit the "unavailable" diagnostic. llvm-svn: 128127
* Convert NonVirtual parameter of ApplyNonVirtualAndVirtualOffset() toKen Dyck2011-03-231-8/+11
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128126
* Fix an error with the declaration of block parameters that dependJohn McCall2011-03-221-5/+14
| | | | | | | on previous block parameters that crept in as part of my captures work a month or so ago. llvm-svn: 128121
* Warn about unused declaration-specifiers on tag declarations.John McCall2011-03-221-10/+42
| | | | llvm-svn: 128118
* Make the definition of "long double" consistent for llvm::Triple::Win32 forEli Friedman2011-03-221-1/+3
| | | | | | both 32-bit and 64-bit targets. llvm-svn: 128110
* Simplify Mac runtime selection - it's the factory function's job to select ↵David Chisnall2011-03-223-16/+4
| | | | | | which class to produce, not CodeGenModule's. llvm-svn: 128109
* Make the property accessor functions that take a ptrdiff_t actually take a ↵David Chisnall2011-03-222-4/+6
| | | | | | ptrdiff_t instead of a long (should have no impact on any sane platforms, but win64 is not sane). llvm-svn: 128104
* Make the ivar offset always be a ptrdiff_t, because stuff in CGObjC.cpp ↵David Chisnall2011-03-221-3/+5
| | | | | | expects this. Actually, it expects a long, but that's a bug that will be fixed in the next commit... llvm-svn: 128102
* Fix typo in comment.Nick Lewycky2011-03-221-1/+1
| | | | llvm-svn: 128088
* Frontend: Add a more explicit -backend-option flag for passing backend commandDaniel Dunbar2011-03-223-3/+10
| | | | | | | | line options, instead of leveraging the blanket -mllvm option. - This allows using the frontend itself without requiring the backend have those options available (i.e., if the target wasn't built). llvm-svn: 128087
* Apply Jonathan Sauer's proposed solution to PR9519. Thanks!John McCall2011-03-221-1/+1
| | | | llvm-svn: 128075
* The emission of an Objective-C++'s class .cxx_destruct method should beJohn McCall2011-03-222-55/+123
| | | | | | | conditioned on whether it has any destructible ivars, not on whether it has any non-trivial class-object initializers. llvm-svn: 128074
* Fix a test case and teach ClearLinkageCache() to clear the linkage ofJohn McCall2011-03-221-1/+3
| | | | | | | a function template decl's pattern, which was suddenly exposed by my last patch. llvm-svn: 128073
* File-scope static functions need to be mangled with 'L' so thatJohn McCall2011-03-221-4/+6
| | | | | | | | they don't collide with file-scope extern functions from the same translation unit. This is basically a matter of applying the same logic to FunctionDecls as we were previously applying to VarDecls. llvm-svn: 128072
* Convert Offset variable in GetAddressOfDirectBaseInCompleteClass() toKen Dyck2011-03-221-5/+5
| | | | | | CharUnits. No change in functionality intended. llvm-svn: 128060
* Rework crash recovery cleanup in ASTUnit and CIndex to recover more memory ↵Ted Kremenek2011-03-221-25/+46
| | | | | | | | during a Sema crash (we have just a handful of leaks left) and to use the simplified cleanup registration API. llvm-svn: 128059
* Remove crash recovery cleanups from TypeLocBuilder. They were a bit error ↵Ted Kremenek2011-03-221-7/+1
| | | | | | prone, only hit in rare cases. llvm-svn: 128058
* Simplify crash recovery cleanup registration.Ted Kremenek2011-03-221-3/+2
| | | | llvm-svn: 128057
* Migrate 'PrettySTackTraceParserEntry' object out of Parser, and have it ↵Ted Kremenek2011-03-222-5/+11
| | | | | | | | constructed within ParseAST. This avoids double crashes during crash recovery. llvm-svn: 128056
* Change return value of ComputeNonVirtualBaseClassOffset() to CharUnits. NoKen Dyck2011-03-221-13/+13
| | | | | | change in functionality intended. llvm-svn: 128050
* Eliminate some literal '8's in FillInNullDataMemberPointers() by switchingKen Dyck2011-03-221-5/+6
| | | | | | to CharUnits. No change in functionality intended. llvm-svn: 128047
* Another cortex-m0 patch from James Orr.Bob Wilson2011-03-211-0/+1
| | | | llvm-svn: 128029
* Add clang support for cortex-m0 cpus. Patch by James Orr.Bob Wilson2011-03-213-1/+12
| | | | llvm-svn: 128018
* Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don'tDaniel Dunbar2011-03-212-8/+15
| | | | | | really make any sense in this environment. llvm-svn: 128014
* Fix an objc++ diagnostic initializing objc pointers.Fariborz Jahanian2011-03-211-4/+10
| | | | | | // rdar:// 9139947 llvm-svn: 128013
* Improve crash recovery cleanup to recovery CompilerInstances during crash ↵Ted Kremenek2011-03-214-99/+81
| | | | | | | | | | recovery. This was a huge resource "root" during crashes. This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance object. llvm-svn: 128011
* Relax assertion to fail during crash recovery cleanup.Ted Kremenek2011-03-211-3/+1
| | | | llvm-svn: 128010
* Use CrashRecoveryContextCleanup objects to reclaim resources from ↵Ted Kremenek2011-03-212-73/+97
| | | | | | CompilerInstance objects. llvm-svn: 128009
* Introduce FindTargetProgramPath to check for a target-specific helperJoerg Sonnenberger2011-03-211-4/+15
| | | | | | | | program and fallback to plain version otherwise. Use this for the NetBSD target to make it try e.g. i486--netbsdelf-as and -ld for target i486--netbsdelf. llvm-svn: 127996
* Memorize presence/absence of -nostdlib in Driver.Joerg Sonnenberger2011-03-212-8/+9
| | | | | | | Drop program paths on NetBSD (unused). Only include lib dir, if -nostdlib is absent. Use = to allow --sysroot to work. llvm-svn: 127995
* Remember sysroot in Driver. Pass it down to ld for NetBSD, FreeBSDJoerg Sonnenberger2011-03-212-6/+25
| | | | | | | and DragonFly. Use the --sysroot= form for Linux. Fix handling of = prefix for -B. llvm-svn: 127994
* Fix Objective-C++ exceptions (GNU runtime).David Chisnall2011-03-205-7/+206
| | | | llvm-svn: 127980
* __cxa_atexit does not throw.Anders Carlsson2011-03-201-0/+2
| | | | llvm-svn: 127977
* Only objects are declared const by a constexpr specifier, per C++0x ↵Peter Collingbourne2011-03-201-2/+4
| | | | | | [dcl.constexpr]p9 llvm-svn: 127967
* Downgrade err_mismatched_exception_spec to a ExtWarning in Microsoft mode. ↵Francois Pichet2011-03-191-11/+10
| | | | | | | | MSVC doesn't do any validation on exception specifications. This remove 1 error when parsing MSVC stl lib with clang. llvm-svn: 127961
* Unbreak build.Daniel Dunbar2011-03-191-1/+2
| | | | llvm-svn: 127942
* Use CharUnits's new increment operator. No change in functionality intended.Ken Dyck2011-03-191-2/+2
| | | | llvm-svn: 127938
* Preprocessor: Don't define __STDC__ in -traditional-cpp mode.Daniel Dunbar2011-03-191-1/+1
| | | | llvm-svn: 127933
* Recovery memory from TypeLocBuilders during crashes.Ted Kremenek2011-03-191-1/+6
| | | | llvm-svn: 127932
* Recover memory from RecordLayoutBuilders during crashes.Ted Kremenek2011-03-191-1/+6
| | | | llvm-svn: 127931
* Rename class 'CFGReachabilityAnalysis' to 'CFGReverseBlockReachabilityAnalysis'.Ted Kremenek2011-03-194-9/+9
| | | | | | | | | This rename serves two purposes: - It reflects the actual functionality of this analysis. - We will have more than one reachability analysis. llvm-svn: 127930
* Replace literal '8's with CharWidth in AppendBitField. No change inKen Dyck2011-03-191-13/+15
| | | | | | functionality intended. llvm-svn: 127927
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-1814-19/+227
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Driver: Forward -traditional and -traditional-cpp in preprocessing modes.Daniel Dunbar2011-03-181-2/+7
| | | | | | | | | - We don't really support the majority of the horrible -traditional-cpp behavior, but it is unlikely that we ever will either. This allows us to start trying to use clang as a /usr/bin/cpp replacement and see what pieces of -traditional-cpp mode people actually care about. llvm-svn: 127911
* Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPLDaniel Dunbar2011-03-182-3/+8
| | | | | | comments. llvm-svn: 127910
* Driver/Darwin: Transparently fallback when compiling i386 -fapple-kext code, weDaniel Dunbar2011-03-181-3/+12
| | | | | | don't support the ABI yet. llvm-svn: 127903
* Driver: Give SelectTool access to the action inputs.Daniel Dunbar2011-03-183-31/+54
| | | | llvm-svn: 127902
* Driver/Darwin: Change fallback to use llvm-gcc search paths instead of GCC.Daniel Dunbar2011-03-181-4/+6
| | | | llvm-svn: 127897
* Driver/Darwin: Kill the DarwinGCC toolchain.Daniel Dunbar2011-03-183-186/+1
| | | | llvm-svn: 127896
* Use the newly added FileManager::getNoncachedStatValue when trying to ↵Anders Carlsson2011-03-181-2/+2
| | | | | | determine if any files in the preamble have changed. llvm-svn: 127894
OpenPOWER on IntegriCloud