Commit Graph

24259 Commits

Author SHA1 Message Date
Fariborz Jahanian 946274471d Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.
Radar 8218839.

llvm-svn: 109272
2010-07-23 21:53:24 +00:00
Devang Patel 28f167699a There is no need to use separate dir name for AT_comp_dir attribute. Using absolute path for filename allows clients to query complete file location info from gdb breakpoints. Save constructed full file name.
llvm-svn: 109263
2010-07-23 20:38:37 +00:00
Fariborz Jahanian b59625ecea Test for selector-warning PCH patch.
radar 6507158.

llvm-svn: 109261
2010-07-23 20:32:57 +00:00
Eli Friedman d4c75cddde Fix for PR7694: make sure to pass in a RecordType to CheckBaseClassAccess;
fixes crashes on both valid and invalid code.  The diagnostic here could
potentially be improved, but it's good enough as-is.

llvm-svn: 109257
2010-07-23 19:25:41 +00:00
Fariborz Jahanian c51609a0b5 PCH read/write for selector reference pool.
Finishes off radar 6507158.

llvm-svn: 109256
2010-07-23 19:11:11 +00:00
Ted Kremenek ac9ca01a80 Dataflow solver: Don't overrwite the initial value of a block with top unless new values are available. Patch by Simone Pellegrini!
llvm-svn: 109243
2010-07-23 18:15:17 +00:00
Douglas Gregor 5cc2c8b9c3 Vectors are not integer types, so the type system should not classify
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.

Patch from Anton Yartsev!

llvm-svn: 109229
2010-07-23 15:58:24 +00:00
Zhongxing Xu 5e6ef6d957 Add FILE* leak check to StreamChecker. Patch by Lei Zhang.
llvm-svn: 109225
2010-07-23 14:14:59 +00:00
Bill Wendling 8abd1ca8d2 Remove unneeded iostream include.
llvm-svn: 109219
2010-07-23 07:19:31 +00:00
Zhongxing Xu 73ede01cad Change arg type.
llvm-svn: 109218
2010-07-23 05:55:01 +00:00
Zhongxing Xu 692ac46a70 Delete unnecessary const_cast.
llvm-svn: 109211
2010-07-23 02:54:53 +00:00
Zhongxing Xu cabfb72654 AnalysisContext is not const.
llvm-svn: 109210
2010-07-23 02:49:07 +00:00
Zhongxing Xu 318e40360d Fix build on Ubuntu 10.04.
llvm-svn: 109208
2010-07-23 02:15:08 +00:00
Douglas Gregor be2d8c6096 Basic plumbing for generating a precompiled preamble for an
ASTUnit/CXTranslationUnit. We can't actually use this preamble yet,
however.

llvm-svn: 109202
2010-07-23 00:33:23 +00:00
Fariborz Jahanian 86151343b4 Warn when property ivar lookup finds a global variable
of same name. In nonfragile-abi2, lookup accesses a synthesized
ivar. This is a transition warning.  Radar 8225011.

llvm-svn: 109197
2010-07-22 23:33:21 +00:00
John McCall 7b5f0fe686 Ted pointed out that this test case could be using access control instead of
__attribute__((unavailable)).  I've done so, but unfortunately there's still a case
of redundant diagnostics.

llvm-svn: 109192
2010-07-22 22:44:38 +00:00
Sebastian Redl c67764eb4b Thread bitstream cursors all the way through the AST reading stuff. This way, reading a trivial 2-element chained file actually works.
llvm-svn: 109191
2010-07-22 22:43:28 +00:00
Devang Patel 0884a60eb5 Keep track of artificial scopes introduced by line directives. For example,
#line 41 "bar.c"
  dummy (1, i);
#line 24 "bar.h"
  i = f2 (i);
#line 44 "bar.c"

This is tested by step-line.exp in gdb testsuite.

llvm-svn: 109189
2010-07-22 22:29:16 +00:00
John McCall 775f9f9919 Turn off EH cleanups for __block variables; they caused some internal buildbot
failures.  There's a radar tracking this.

llvm-svn: 109170
2010-07-22 21:25:44 +00:00
Douglas Gregor cd8bdd025f Improve performance during cursor traversal when a region of interest
is present. 

Rather than using clang_getCursorExtent(), which requires
us to lex the token at the ending position to determine its
length. Then, we'd be comparing [a, b) source ranges that cover the
characters in the range rather than the normal behavior for Clang's
source ranges, which covers the tokens in the range. However, relexing
causes us to read the source file (which may come from a precompiled
header), which is rather unfortunate and affects performance.

In the new scheme, we only use Clang-style source ranges that cover
the tokens in the range. At the entry points where this matters
(clang_annotateTokens, clang_getCursor), we make sure to move source
locations to the start of the token.

Addresses most of <rdar://problem/8049381>.

llvm-svn: 109134
2010-07-22 20:22:31 +00:00
Fariborz Jahanian 6e7e8cc19d atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.

llvm-svn: 109129
2010-07-22 18:24:20 +00:00
Nick Lewycky a11b4bfcbe Don't crash when an explicit template instantiation has no user-written
arguments. This happens in clang itself where template:

  template <typename T> T const *getAs();

gets specialized with:

  template<> inline clang::TypedefType const *getAs() { ... }

and there's no TemplateArgumentList.

llvm-svn: 109127
2010-07-22 17:56:53 +00:00
Argyrios Kyrtzidis 7609bca74c Serialization is implemented, fix comments.
llvm-svn: 109124
2010-07-22 17:28:27 +00:00
Argyrios Kyrtzidis 2d8891cd5d Read/write C++0x static_assert for PCH.
llvm-svn: 109123
2010-07-22 17:28:12 +00:00
Sebastian Redl 5c415f3e32 Allow loading declcontext information from any file in the chain. Properly write source locations to dependent files. WIP
llvm-svn: 109119
2010-07-22 17:01:13 +00:00
Argyrios Kyrtzidis 165b58181f Read/write FriendTemplateDecl for PCH.
llvm-svn: 109113
2010-07-22 16:04:10 +00:00
Argyrios Kyrtzidis 47cd7a91f4 Support C++ try/catch statements for PCH.
llvm-svn: 109112
2010-07-22 16:03:56 +00:00
Zhongxing Xu f0c133fe88 This patch adds support for tmpfile in StreamChecker. Patch by Lei Zhang.
llvm-svn: 109106
2010-07-22 14:01:01 +00:00
Zhongxing Xu adf644d05e Make a bunch of new data structures for the new analysis
engine of the new translation unit. State marshal is there but no real
work is done. End nodes are passed back.

llvm-svn: 109105
2010-07-22 13:52:13 +00:00
Ted Kremenek 60fe71a9e3 Fix '<rdar://problem/8214263> MakeCXCursor null dereference when body of block is invalid' by checking that the body of a BlockDecl is null before constructing a CXCursor.
llvm-svn: 109097
2010-07-22 11:30:19 +00:00
Ted Kremenek 2238bc156e Update test case to include USRs containing offsets instead of line/columns.
llvm-svn: 109096
2010-07-22 11:30:17 +00:00
Ted Kremenek 1eb888e9c3 Switch USR generation to use file offsets instead of line/columns for anonymous symbols. Fixes <rdar://problem/8221557>.
llvm-svn: 109095
2010-07-22 11:14:15 +00:00
Chandler Carruth 3c31aa3a44 Fix PR7673 by allowing an empty clobbers section in an ASM statement.
llvm-svn: 109087
2010-07-22 07:11:21 +00:00
Chandler Carruth 96f2e9e418 Add alternate names for x86 SIMD intrinsics. These aren't as common, but show
up enough to be worth supporting properly. Fixes PR7674.

llvm-svn: 109086
2010-07-22 06:47:28 +00:00
Chandler Carruth 718df592f7 This was still complaining about the length of the string. I've broken it here
to try to keep as much logical grouping as possible.

llvm-svn: 109085
2010-07-22 06:29:13 +00:00
Daniel Dunbar 15d8830ea6 tests: Make FileCheck version check that preamble isn't longer than we expected.
llvm-svn: 109077
2010-07-22 02:22:24 +00:00
Daniel Dunbar 6d48476446 Driver/Darwin: Set -force_cpusubtype_ALL only by default on x86.
llvm-svn: 109074
2010-07-22 01:47:22 +00:00
Daniel Dunbar 43d74a3b02 build: Make sure arm_neon.h gets installed.
llvm-svn: 109073
2010-07-22 01:19:36 +00:00
Daniel Dunbar a66a4d10ae Driver/Darwin: Always allow blocks on Darwin, so that users can conditionally
use blocks even when targetting older systems (using runtime checks and weak
linking).

llvm-svn: 109072
2010-07-22 00:40:31 +00:00
Devang Patel 222f4be834 ObjCId is special "struct objc_object". Make this explicit in debug info.
This is tested by objc-rbreak.exp in gdb testsuite.

llvm-svn: 109050
2010-07-21 22:41:25 +00:00
Sebastian Redl 4e6c567653 Allow loading macros from any file in the chain. WIP
llvm-svn: 109048
2010-07-21 22:31:37 +00:00
Daniel Dunbar 26d0aa19d4 tests: XFAIL this test on win32, someone else can hunt this one down.
llvm-svn: 109044
2010-07-21 22:09:09 +00:00
Ted Kremenek 1ddd6d2b6b Upgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior. Note that
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now
Clang's behavior is more strict in this case, but more consistent.  We will need to see how much
this fires on real code and determine whether this case should be downgraded to a warning.

Fixes <rdar://problem/8213093>.

llvm-svn: 109033
2010-07-21 20:43:11 +00:00
Sebastian Redl fa0614458a Promote some macro-related stuff to per-file data. Fix a cache-inefficient nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets.
llvm-svn: 109030
2010-07-21 20:07:32 +00:00
Daniel Dunbar cb08212fd5 tests: Use FileCheck instead of external input; I think this test was failing on
Win32 because of line ending differences.

llvm-svn: 109029
2010-07-21 19:40:01 +00:00
Douglas Gregor 99d2cf4838 Introduce a new C API function, clang_parseTranslationUnit(), which
will eventually replace
clang_createTranslationUnitFromSourceFile(). The only addition in
clang_parseTranslationUnit() is a set of flags that can control how
the translation unit is loaded. More interesting flags will be coming.

llvm-svn: 109027
2010-07-21 18:52:53 +00:00
Fariborz Jahanian da2da9c93e Added extra check when looking for location of '=' in
a copy initialization.

llvm-svn: 109025
2010-07-21 18:40:47 +00:00
Fariborz Jahanian 3fd2a555d3 Fix source location of the initializer in
a copy initialization. Back out hack in objc rewriter.
fixes radar 8213998.

llvm-svn: 109024
2010-07-21 18:31:47 +00:00
Nate Begeman 45595cf99f Catch thinko that Daniel Dunbar found.
llvm-svn: 109023
2010-07-21 18:11:42 +00:00
Devang Patel 65497583b5 Fix regression caused by r108911.
Do not override known debug loc with unknown debug loc.
This is tested by sections.exp in gdb testsuite.

llvm-svn: 109022
2010-07-21 18:08:50 +00:00