Chris Lattner
7f9fc3f7ce
switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128142 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 04:04:01 +00:00
Chris Lattner
0ff8818a23
remove a dead variable.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 04:03:30 +00:00
Ted Kremenek
9d5a165d30
Fix crash in clang_getInstantiationLoc() when SourceManager::getInstantiationLoc() can return a SourceLocatin with an invalid
...
FileID on invalid code. Fixes <rdar://problem/9164623>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128139 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 02:16:44 +00:00
Ted Kremenek
114d63955f
std::vector::data() is not portable to VS. Use a gross hack instead.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128138 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 02:16:41 +00:00
Ken Dyck
d6fb21fa10
Convert OffsetFromNearestVBast parameter of InitializeVTablePointer(s) to
...
CharUnits. No change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 01:04:18 +00:00
Douglas Gregor
0a0d2b1790
Implement a new 'availability' attribute, that allows one to specify
...
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 00:50:03 +00:00
Ken Dyck
9a8ad9b28d
Convert NonVirtual parameter of ApplyNonVirtualAndVirtualOffset() to
...
CharUnits. No change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-23 00:45:26 +00:00
John McCall
4f38f414b8
Fix an error with the declaration of block parameters that depend
...
on previous block parameters that crept in as part of my captures
work a month or so ago.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128121 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 23:15:50 +00:00
John McCall
ac4df2454d
Warn about unused declaration-specifiers on tag declarations.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128118 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 23:00:04 +00:00
Eli Friedman
d9c3fa30bc
Make the definition of "long double" consistent for llvm::Triple::Win32 for
...
both 32-bit and 64-bit targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 21:25:11 +00:00
David Chisnall
60be607e5d
Simplify Mac runtime selection - it's the factory function's job to select which class to produce, not CodeGenModule's.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128109 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 21:21:24 +00:00
Ted Kremenek
4ee9926671
Hopefully fix VS build by not using std::vector::data().
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128105 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 20:16:19 +00:00
David Chisnall
ab5824e976
Make the property accessor functions that take a ptrdiff_t actually take a ptrdiff_t instead of a long (should have no impact on any sane platforms, but win64 is not sane).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128104 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 20:03:13 +00:00
David Chisnall
7e02d1aebb
Make the ivar offset always be a ptrdiff_t, because stuff in CGObjC.cpp expects this. Actually, it expects a long, but that's a bug that will be fixed in the next commit...
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 19:57:51 +00:00
Nick Lewycky
c3e494047b
Fix typo in comment.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128088 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 17:35:47 +00:00
Daniel Dunbar
3c66d30d51
Frontend: Add a more explicit -backend-option flag for passing backend command
...
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).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128087 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 16:48:17 +00:00
Benjamin Kramer
e5a3ce6dd5
Don't clear OverloadCandidateSets on destruction, it has no effect anymore.
...
And clearing a SmallPtrSet can be an expensive operation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128081 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 09:46:54 +00:00
John McCall
850d3b304b
Apply Jonathan Sauer's proposed solution to PR9519. Thanks!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128075 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 07:16:37 +00:00
John McCall
e81ac69c5d
The emission of an Objective-C++'s class .cxx_destruct method should be
...
conditioned on whether it has any destructible ivars, not on whether
it has any non-trivial class-object initializers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128074 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 07:05:39 +00:00
John McCall
78951941f3
Fix a test case and teach ClearLinkageCache() to clear the linkage of
...
a function template decl's pattern, which was suddenly exposed by my
last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128073 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 06:58:49 +00:00
John McCall
74990f45b0
File-scope static functions need to be mangled with 'L' so that
...
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 06:34:45 +00:00
Ken Dyck
5fff46b653
Convert Offset variable in GetAddressOfDirectBaseInCompleteClass() to
...
CharUnits. No change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128060 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 01:21:15 +00:00
Ted Kremenek
25a11e1c5f
Rework crash recovery cleanup in ASTUnit and CIndex to recover more memory during a Sema crash (we have just a handful of leaks left)
...
and to use the simplified cleanup registration API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128059 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 01:15:24 +00:00
Ted Kremenek
b995e04b90
Remove crash recovery cleanups from TypeLocBuilder. They were a bit error prone, only hit in rare cases.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 01:15:21 +00:00
Ted Kremenek
43d8bcfc36
Simplify crash recovery cleanup registration.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 01:15:19 +00:00
Ted Kremenek
614f96a7cf
Migrate 'PrettySTackTraceParserEntry' object out of Parser, and have it constructed within ParseAST. This avoids double crashes
...
during crash recovery.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 01:15:17 +00:00
Ken Dyck
55c02585de
Change return value of ComputeNonVirtualBaseClassOffset() to CharUnits. No
...
change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128050 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 00:53:26 +00:00
Ken Dyck
c4d68db139
Eliminate some literal '8's in FillInNullDataMemberPointers() by switching
...
to CharUnits. No change in functionality intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 00:24:31 +00:00
Matt Beaumont-Gay
90e23204db
Output to tempfile
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128043 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-22 00:19:31 +00:00
Bob Wilson
a291d5fb78
Another cortex-m0 patch from James Orr.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128029 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 21:55:25 +00:00
Bob Wilson
1ec0ade3bb
Add clang support for cortex-m0 cpus. Patch by James Orr.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128018 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 20:40:05 +00:00
Ted Kremenek
b26fbc1382
scan-build: only display analyzer intra-file progress when in "Verbose" mode.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128015 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 20:12:21 +00:00
Daniel Dunbar
da60885cb4
Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don't
...
really make any sense in this environment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128014 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 19:37:38 +00:00
Fariborz Jahanian
84950c7fec
Fix an objc++ diagnostic initializing objc pointers.
...
// rdar:// 9139947
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128013 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 19:08:42 +00:00
Ted Kremenek
4f32786ac4
Improve crash recovery cleanup to recovery CompilerInstances during crash 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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128011 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 18:40:17 +00:00
Ted Kremenek
cd1eecfe4f
Relax assertion to fail during crash recovery cleanup.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128010 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 18:40:10 +00:00
Ted Kremenek
03201fbbde
Use CrashRecoveryContextCleanup objects to reclaim resources from CompilerInstance objects.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128009 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 18:40:07 +00:00
Chris Lattner
c70e193052
and now there are 3!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128001 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 16:25:11 +00:00
Joerg Sonnenberger
10c6435e90
Introduce FindTargetProgramPath to check for a target-specific helper
...
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127996 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 14:01:40 +00:00
Joerg Sonnenberger
05e5930166
Memorize presence/absence of -nostdlib in Driver.
...
Drop program paths on NetBSD (unused). Only include lib dir, if
-nostdlib is absent. Use = to allow --sysroot to work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 13:59:26 +00:00
Joerg Sonnenberger
8ab2bdcc4f
Remember sysroot in Driver. Pass it down to ld for NetBSD, FreeBSD
...
and DragonFly. Use the --sysroot= form for Linux. Fix handling of =
prefix for -B.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127994 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 13:51:29 +00:00
Bill Wendling
ad3dfbe463
Pass in the TargetMachine parameter to the inst printer.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127987 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 05:02:03 +00:00
Peter Collingbourne
38448d3ae8
Code modification hints have been known as fix-it hints for almost
...
a year now. Update the internals manual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127983 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-21 01:45:18 +00:00
David Chisnall
80558d2db1
Fix Objective-C++ exceptions (GNU runtime).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127980 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-20 21:35:39 +00:00
Anders Carlsson
bd4a0732f2
__cxa_atexit does not throw.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127977 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-20 20:52:32 +00:00
Argyrios Kyrtzidis
c842955140
In clang_parseTranslationUnit_Impl,p ut the source file after command_line_args otherwise
...
if '-x' flag is present it will be unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127971 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-20 18:17:52 +00:00
Peter Collingbourne
148f1f7936
Only objects are declared const by a constexpr specifier, per C++0x [dcl.constexpr]p9
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-20 08:06:45 +00:00
Francois Pichet
eedd4670b2
Downgrade err_mismatched_exception_spec to a ExtWarning in Microsoft mode. MSVC doesn't do any validation on exception specifications.
...
This remove 1 error when parsing MSVC stl lib with clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-19 23:05:18 +00:00
Benjamin Kramer
ba814e775e
Initialize FakeAddressSpaceMap flag.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127950 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-19 13:04:25 +00:00
Anton Yartsev
e5da3e6e56
makes vec_step operator work when AltiVec support is enabled
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127949 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-19 07:53:43 +00:00