Commit Graph

4904 Commits

Author SHA1 Message Date
Steve Naroff 8206de760b Add a "t".
llvm-svn: 75810
2009-07-15 18:50:21 +00:00
Steve Naroff 1329fa0ed9 Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).
This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.

llvm-svn: 75808
2009-07-15 18:40:39 +00:00
Zhongxing Xu 12b1d137c2 Add getName() method to Entity.
llvm-svn: 75740
2009-07-15 04:39:21 +00:00
Ted Kremenek e6fea68c46 More test cases revealed that the logic in StoreManager::InvalidateRegion() needs more finesse when handling the invalidation of pointers. Pointers that were invalidated as integers could later cause problems for clients using them as pointers. It is easier for us to model a symbolic value as a pointer rather than modeling a non-symbolic value as a pointer.
This patch causes:
- StoreManager::InvalidateRegion() to not used the casted type of a region if
  it would cause a pointer type to be invalidated as a non-pointer type.
- Pushes RegionStore::RetrieveElement() further by handling retrievals from
  symbolic arrays that have been invalidated.  This uses the new SymbolDerived
  construct that was recently introduced.
  
The result is that the failing test in misc-ps-region-store-x86_64.m now passes.
Both misc-ps-region-store-x86_64.m and misc-ps-region-store-i386.m contain a
test case that motivated this change.

llvm-svn: 75730
2009-07-15 02:31:43 +00:00
Ted Kremenek c6c2157836 Introduced the notion of a "derived symbol" using the class SymbolDerived.
SymbolDerived allows us to model symbolic values that are related to other
symbols via a region hierarchy. For example, SymbolDerived can be used to model
individual values of a symbolic array.

llvm-svn: 75728
2009-07-15 02:27:32 +00:00
Eli Friedman bb0d9a5129 Remove -ftraditional option, which gcc doesn't actually support. Make
using -traditional and -traditional-cpp with clang an error because 
it's unsupported in clang and causes a significant change in the 
semantics of the language.

llvm-svn: 75690
2009-07-14 21:58:17 +00:00
Steve Naroff 6b712a7ba1 Introduce Type::isAnyPointerType() and convert all clients (suggested by Chris).
I don't love the name, however it simplifies the code and is a worthwhile change. If/when we come up with a better name, we can do a search/replace.

llvm-svn: 75650
2009-07-14 18:25:06 +00:00
Fariborz Jahanian 49c81799b0 Patch to build AST for ctor's initializer list according to
semantics of order of construction [class.init].

llvm-svn: 75649
2009-07-14 18:24:21 +00:00
Anders Carlsson 466fd0a16d Rename RecordLayout.h to ASTRecordLayout.h
llvm-svn: 75641
2009-07-14 17:29:11 +00:00
Steve Naroff 5ec6ff7678 Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.
Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).
llvm-svn: 75635
2009-07-14 14:58:18 +00:00
Alisdair Meredith a9ad47d94c Basic support for C++0x unicode types. Support for literals will follow in an incremental patch
llvm-svn: 75622
2009-07-14 06:30:34 +00:00
Argyrios Kyrtzidis 1506d9bc25 Introduce redecl_iterator, used for iterating over the redeclarations of a FunctionDecl or VarDecl.
It iterates over all the redeclarations, regardless of the starting point. For example:

1) int f();
2) int f();
3) int f();

if you have the (2) FunctionDecl and call redecls_begin/redecls_end to iterate, you'll get this sequence:
(2)
(1)
(3)

The motivation to introduce this was that, previously, if (3) was a function definition,
and you called getBody() at (2), it would not return it, since getBody() iterated over the previous declarations only,
so it would only check (2) and (1).

llvm-svn: 75604
2009-07-14 03:20:21 +00:00
Argyrios Kyrtzidis 0736c5ca3b Introduce FunctionDecl::getLatestDeclaration() and VarDecl::getLatestDeclaration().
For multiple redeclarations they return the last one.

Also, add some non const versions of methods.

llvm-svn: 75603
2009-07-14 03:20:08 +00:00
Argyrios Kyrtzidis ef17c07bf6 Introduce FunctionDecl::getFirstDeclaration() and VarDecl::getFirstDeclaration().
For multiple redeclarations they return the first one.

llvm-svn: 75602
2009-07-14 03:19:57 +00:00
Argyrios Kyrtzidis eeaaead736 Read/write a CXXOperatorCallExpr from/to PCH files.
llvm-svn: 75598
2009-07-14 03:19:21 +00:00
Argyrios Kyrtzidis 23e1f1d6be Pass the right brace SourceLocation from the Parser to the TagDecls.
llvm-svn: 75591
2009-07-14 03:17:52 +00:00
Argyrios Kyrtzidis 575fa05991 Add the SourceLocation for the right brace in TagDecl.
llvm-svn: 75590
2009-07-14 03:17:17 +00:00
Zhongxing Xu 170e816eff Instead of recovering from a wrong invalidation, this patch aims to
invalidate the region correctly. It uses the cast-to type to invalidate 
the region when available. To avoid invalid cast-to type like 'void*' or 'id',
region store now only records non-generic casts of regions.

llvm-svn: 75580
2009-07-14 01:12:46 +00:00
Ted Kremenek a6904ff7f9 Tidy pretty-printing for SVals, using 'dump()' instead of 'printStdErr()', and implementing operator<< support for llvm::raw_ostream.
llvm-svn: 75560
2009-07-13 23:53:06 +00:00
Ted Kremenek eabdd984b1 Change pretty-printing API for SymExprs and MemRegions to use a naming convention and style similar to other elements in Clang.
llvm-svn: 75548
2009-07-13 23:31:04 +00:00
Steve Naroff 2efbbe3531 - Improve comment for Type::getPointeeType().
- Remove a couple redundant casts/returns.
- Fix 80 column violations for all getAsStringInternal() methods.

llvm-svn: 75485
2009-07-13 19:06:52 +00:00
Daniel Dunbar 2e5be09280 Match declaration to definition.
llvm-svn: 75441
2009-07-12 23:52:11 +00:00
Daniel Dunbar 593c36c1c8 Match declaration to definition.
llvm-svn: 75439
2009-07-12 22:53:49 +00:00
Chris Lattner 000628da61 fix typo in file headers.
llvm-svn: 75436
2009-07-12 22:31:02 +00:00
Chris Lattner c638161d38 improve comments.
llvm-svn: 75435
2009-07-12 22:29:59 +00:00
Chris Lattner fb42a1820f add push/pop semantics for diagnostics. Patch by Louis Gerbarg!
llvm-svn: 75431
2009-07-12 21:18:45 +00:00
Anders Carlsson ae01993a12 Implement more of C++0x 'auto'. A variable with an auto type specifier must have an initializer. Also, move some tests around to match the C++0x draft better.
llvm-svn: 75322
2009-07-11 00:34:39 +00:00
Steve Naroff 7cae42b07a This patch includes a conceptually simple, but very intrusive/pervasive change.
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time. 

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.

llvm-svn: 75314
2009-07-10 23:34:53 +00:00
Fariborz Jahanian 3554b5a37c Patch to build list of inherited virtual base classes
in their order of construction for each class and use it 
to to check on propery order of base class construction 
under -Wreorder option.

llvm-svn: 75270
2009-07-10 20:13:23 +00:00
Anders Carlsson ea1cfb415b Fix a problem that Eli noticed, and that Doug helped me fix.
llvm-svn: 75265
2009-07-10 19:20:26 +00:00
Ted Kremenek da98f732cb Rename potentially ambiguous member template 'getRegion' to 'getSubRegion' to hopefully resolve template lookup ambiguities on some compilers.
llvm-svn: 75253
2009-07-10 16:51:45 +00:00
Ted Kremenek f66557978e Switch BasicStoreManager to use the new CastRegion implementation by default,
and replace the 'clang-cc' option '-analyzer-store=basic-new-cast' with
'-analyzer-store=basic-old-cast'. We'll keep the old CastRegion implementation
around for a little while for regression testing.

llvm-svn: 75209
2009-07-10 00:41:58 +00:00
Fariborz Jahanian 5582f231f2 don't crash if class is using itself as its super class.
llvm-svn: 75178
2009-07-09 22:08:26 +00:00
Fariborz Jahanian 341583c3ac Sema check on out of order object initialization of
class object's base and members under -Wreorder flag.

llvm-svn: 75168
2009-07-09 19:59:47 +00:00
Anders Carlsson 03f89b1828 Store the isAddressOfOperand in the UnresolvedDeclRefExpr, so that we can pass it when instantiating the expr. Fixes another member pointer bug.
llvm-svn: 75075
2009-07-09 00:05:08 +00:00
Douglas Gregor b257e4fff8 Implement the simple form of overload resolution used when taking the
address of an overloaded function (which may involve both functions
and function templates). 

llvm-svn: 75069
2009-07-08 23:33:52 +00:00
Ted Kremenek 8ee3dd7cc5 Fix: <rdar://problem/7034511> ValueManager::makeIntVal(uint64_t X, QualType T) should return a 'Loc' when 'T' is a pointer
llvm-svn: 75062
2009-07-08 22:42:46 +00:00
Anders Carlsson 0b675f5ad5 It's not allowed to form member pointers to members that have reference type. Add a test for this and the rest of [dcl.mptr]p3.
llvm-svn: 75054
2009-07-08 21:45:58 +00:00
Douglas Gregor 79ca34de78 Bump the PCH version number
llvm-svn: 75049
2009-07-08 21:07:44 +00:00
Chris Lattner 26670dcba1 fix PR4513, a build problem with VC++, patch by James Abbatiello!
llvm-svn: 75013
2009-07-08 16:24:37 +00:00
Douglas Gregor be759256b9 Fix a corner case with argument-dependent lookup and overloaded function sets.
llvm-svn: 74999
2009-07-08 10:57:20 +00:00
Argyrios Kyrtzidis d8ffadcd82 Initialize the ConstantArraySizeAsWritten field of PrintingPolicy class.
It contained garbage since the constructor didn't initialize it and caused test/Sema/array-constraint.c to randomly fail.

llvm-svn: 74989
2009-07-08 02:17:42 +00:00
Fariborz Jahanian 5f21d2f69a Implemented memmove_collectable API for Next runtime
when struct variables with GC'able members are copied into.
Will provide a test case later.

llvm-svn: 74984
2009-07-08 01:18:33 +00:00
Douglas Gregor abd6813ff9 The canonical type of typeof or decltype with a dependent type is itself,
not Context.DependentTy. I'll let Anders check in the test case for this one...

llvm-svn: 74975
2009-07-08 00:03:05 +00:00
Sebastian Redl 86be854fa8 Implement checking of exception spec compatibility for overriding virtual functions.
llvm-svn: 74943
2009-07-07 20:29:57 +00:00
Anders Carlsson 1f9648da17 Some (most) type trait expressions require that the argument passed in is a complete type.
llvm-svn: 74937
2009-07-07 19:06:02 +00:00
Douglas Gregor 27821cee82 Make ASTContext explicitly keep track of the declaration for the C
FILE type, rather than using name lookup to find FILE within the
translation unit. Within precompiled headers, FILE is treated as yet
another "special type" (like __builtin_va_list).

This change should provide a performance improvement (not verified),
since the lookup into the translation unit declaration 
forces the (otherwise unneeded) construction of a large hash table.
More importantly, with precompiled headers, the construction
of that table requires deserializing most of the top-level
declarations from the precompiled header, which are then unused.

Fixes PR 4509.

llvm-svn: 74911
2009-07-07 16:35:42 +00:00
Fariborz Jahanian 003a880c41 A few change per Doug's feedback.
- Fariborz

llvm-svn: 74909
2009-07-07 16:24:08 +00:00
Douglas Gregor 0086a5a3bb Introduce the notion of "Relocatable" precompiled headers, which are built
with a particular system root directory and can be used with a different
system root directory when the headers it depends on have been installed.
Relocatable precompiled headers rewrite the file names of the headers used
when generating the PCH file into the corresponding file names of the 
headers available when using the PCH file.

Addresses <rdar://problem/7001604>.

llvm-svn: 74885
2009-07-07 00:12:59 +00:00
Ted Kremenek fdf5d802a8 Unbreak build by including header.
llvm-svn: 74870
2009-07-06 22:26:23 +00:00
Ted Kremenek eea8c29aa3 Make 'BasicStoreManager' + 'NewCastRegion' testable from the command line using '-analyzer-store=basic-new-cast'.
llvm-svn: 74865
2009-07-06 21:58:46 +00:00
Argyrios Kyrtzidis b8020f0833 Some changes to ASTLocation's methods
-Change hasStmt() to isStmt()
-Add isDecl()
-Add getSourceRange()

llvm-svn: 74862
2009-07-06 21:35:20 +00:00
Argyrios Kyrtzidis b89c4cba7d Add some comments to the ASTLocation class.
llvm-svn: 74861
2009-07-06 21:35:09 +00:00
Argyrios Kyrtzidis f24249554b Move the 'ResolveLocationInAST' function from the Frontend library to the Index library.
Also, cut down its comments; more comments will be added to ASTLocation.

llvm-svn: 74860
2009-07-06 21:35:02 +00:00
Argyrios Kyrtzidis 63afa49add Move ASTLocation and DeclReferenceMap from the AST library to the Index library.
llvm-svn: 74859
2009-07-06 21:34:47 +00:00
Argyrios Kyrtzidis b0048027ba Rename 'ASTNode' -> 'ASTLocation'.
ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST.

llvm-svn: 74858
2009-07-06 21:34:20 +00:00
Ted Kremenek 9e010e11c3 Move the new 'CastRegion' implementation from RegionStoreManager to StoreManager
(its superclass). This will allow us to experiment with using the new CastRegion
with BasicStoreManager, and gradually phase out the old implementation.

llvm-svn: 74851
2009-07-06 20:21:51 +00:00
Douglas Gregor 1342e84c17 Fix PR 4489, a crash in PCH loading that occurs when loading the name
of a top-level declaration loads another top-level declaration of the
same name whose type depends on the first declaration having been
completed. This commit breaks the circular dependency by delaying
loads of top-level declarations triggered by loading a name until we
are no longer recursively loading types or declarations.

llvm-svn: 74847
2009-07-06 18:54:52 +00:00
Douglas Gregor 04318256b7 Keep track of the Expr used to describe the size of an array type,
from Enea Zaffanella!

llvm-svn: 74831
2009-07-06 15:59:29 +00:00
Zhongxing Xu e1a3ace8ab Further cleanup of region invalidation code. No functionality change.
llvm-svn: 74816
2009-07-06 06:01:24 +00:00
Zhongxing Xu 45b5302eaa AllocaRegion and SymbolicRegion are both boundable.
llvm-svn: 74815
2009-07-06 05:34:56 +00:00
Zhongxing Xu 1fb1cf4e26 Start to gradually move region invalidation code into store manager.
No functionality change. 

llvm-svn: 74812
2009-07-06 03:41:27 +00:00
Argyrios Kyrtzidis fe37cc831b Introduce the 'Index' library.
Its purpose is to provide the basic infrastructure for cross-translation-unit analysis like indexing, refactoring, etc.

Currently it is very "primitive" and with no type-names support. It can provide functionality like
"show me all references of this function from these translation units".

llvm-svn: 74802
2009-07-05 22:22:19 +00:00
Argyrios Kyrtzidis e568a9792f Introduce the DeclReferenceMap class inside the AST library.
DeclReferenceMap (similar to ParentMap) is a helper class for mapping Decls to the AST nodes that reference them.
A client will initialize it by passing an ASTContext to its constructor and later use it to iterate over
the references of a Decl.
References are mapped and retrieved using the primary declaration (Decl::getPrimaryDecl()) of a particular Decl.

llvm-svn: 74801
2009-07-05 22:22:06 +00:00
Argyrios Kyrtzidis 02dd4f9389 Introduce the virtual method Decl::getPrimaryDecl().
When a Decl subclass can have multiple re-declarations in the same declaration context (like FunctionDecl),
getPrimaryDecl() will return a particular Decl that all of them will point to as the "primary" declaration.

llvm-svn: 74800
2009-07-05 22:21:56 +00:00
Argyrios Kyrtzidis a4d36d5a58 Make use of ASTNode for return value of clang::ResolveLocationInAST() and in the index-test tool.
llvm-svn: 74798
2009-07-05 22:21:40 +00:00
Argyrios Kyrtzidis 97e10d64e8 Introduce ASTNode class into the AST library.
ASTNode is an immutable pair of a Decl and Stmt. If Stmt is not null, Decl should be its immediate parent.

llvm-svn: 74797
2009-07-05 22:21:28 +00:00
Zhongxing Xu 66db13b7ac CompoundLiteralRegion is boundable when it is not in the file scope.
llvm-svn: 74788
2009-07-04 11:43:03 +00:00
Sebastian Redl 4f4d7b5d8e Catch function redeclarations with incompatible exception specifications.
llvm-svn: 74787
2009-07-04 11:39:00 +00:00
Zhongxing Xu 108f89cbfa StringRegion is not boundable.
llvm-svn: 74786
2009-07-04 11:31:53 +00:00
Zhongxing Xu 61e6692993 remove utility methods that are not very useful.
llvm-svn: 74762
2009-07-03 06:11:41 +00:00
Ted Kremenek 06cc0e31b2 Replace guarded calls in RegionStoreManager to
ValueManager::getRegionValueSymbolVal() with unguarded calls to
ValueManager::getRegionValueSymbolValOrUnknown(). This changes centralizes the
decision of what values to symbolicate in SymbolManager rather than having it
scatter in RegionStoreManager.

llvm-svn: 74730
2009-07-02 22:16:42 +00:00
Fariborz Jahanian 9fa077c626 Patch to allocate list of bases in CXXRecordDecl
using ASTContxt allocation.

llvm-svn: 74717
2009-07-02 18:26:15 +00:00
Ted Kremenek df67d426d9 StoreManagers: Use 'hasGlobalsStorage()' and 'hasParametersStorage()' instead of
directly consulting if a VarDecl is an implicit or actual parameter, a global,
etc.

llvm-svn: 74716
2009-07-02 18:25:09 +00:00
Ted Kremenek 7e4a9a02c3 Add a separate MemSpaceRegion for function/method arguments passed on the stack.
This will simplify the logic of StoreManagers that want to specially reason
about the values of parameters.

llvm-svn: 74715
2009-07-02 18:14:59 +00:00
Ted Kremenek df15d29f17 Remove commented methods. Add MemRegion::printStdErr().
llvm-svn: 74709
2009-07-02 17:24:10 +00:00
Douglas Gregor c6d5edd2ed Add support for retrieving the Doxygen comment associated with a given
declaration in the AST. 

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment, 
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile). 

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
  - We don't actually attempt to parse the comment blocks themselves,
  beyond identifying them as Doxygen comment blocks to associate them
  with a declaration.
  - We won't find comment blocks that aren't adjacent to the
  declaration, because we start our search based on the location of
  the declaration.
  - We don't go through the necessary hops to find, for example,
  whether some redeclaration of a declaration has comments when our
  current declaration does not. Similarly, we don't attempt to
  associate a \param Foo marker in a function body comment with the
  parameter named Foo (although that is certainly possible).
  - Verification of my "no performance impact" claims is still "to be
  done".

llvm-svn: 74704
2009-07-02 17:08:52 +00:00
Fariborz Jahanian 5c6af0a998 Use Destroy for member initializer list clean up.
Per Doug's comments. Doug please review.

llvm-svn: 74666
2009-07-01 23:35:25 +00:00
Owen Anderson ecaeaa81b1 Update for changes in LLVM. Hopefully this is the last one for a while.
llvm-svn: 74657
2009-07-01 23:14:14 +00:00
Douglas Gregor ff6cbdf806 Keep track of more information within the template instantiation stack, e.g.,
by distinguishing between substitution that occurs for template
argument deduction vs. explicitly-specifiad template arguments. This
is used both to improve diagnostics and to make sure we only provide
SFINAE in those cases where SFINAE should apply.

In addition, deal with the sticky issue where SFINAE only considers
substitution of template arguments into the *type* of a function
template; we need to issue hard errors beyond this point, as
test/SemaTemplate/operator-template.cpp illustrates.

llvm-svn: 74651
2009-07-01 22:01:06 +00:00
Owen Anderson 03200753ee Hold the LLVMContext by reference instead of by pointer.
llvm-svn: 74642
2009-07-01 21:23:16 +00:00
Fariborz Jahanian 52337414b7 Updated CXXConstructorDecl AST node for ctor-initilaizer list.
No change in functionality.

llvm-svn: 74639
2009-07-01 21:05:43 +00:00
Daniel Dunbar 82ef1abf43 Driver: Mark some Compilation members const.
llvm-svn: 74636
2009-07-01 20:30:52 +00:00
Daniel Dunbar 38bfda6ab5 Driver: Move Compilation::Execute to Driver::ExecuteCompilation.
- The Compilation is just a helper class, it shouldn't have that amount of
   logic in it.

 - No functionality change.

llvm-svn: 74634
2009-07-01 20:03:04 +00:00
Fariborz Jahanian c1fc3ec878 Patch to implement template types in ctor-initializer list.
Also has fix for bugzilla-4469.

llvm-svn: 74631
2009-07-01 19:21:19 +00:00
Daniel Dunbar aa246cafaa Driver: Improve diagnostics for failed commands.
- Not all tools give good error messages, and sometimes the tool can fail w/o
   any error (for example, when signalled).

 - We suppress this message when the failing command is the compiler and it
   failed normally (exit code == 1), under the assumption that it gave a good
   diagnostic.

For example, for a linker failure we now get:
--
ddunbar@lordcrumb:tmp$ clang a.c b.c
ld: duplicate symbol _x in /var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-bXYITq.o and /var/folders/cl/clrOX6SaG+moCeRKEI4PtU+++TI/-Tmp-/cc-6uK4jD.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--

For a compiler crash we get:
--
ddunbar@lordcrumb:tmp$ clang t.i
Assertion failed: (CGT.getTargetData().getTypeAllocSizeInBits(STy) == RL.getSize()), function layoutStructFields, file CodeGenTypes.cpp, line 573.
0   clang-cc          0x0000000100f1f1f1 PrintStackTrace(void*) + 38
... stack trace and virtual stack trace follow ...
clang: error: compiler command failed due to signal 6 (use -v to see invocation)
--

But for a regular compilation failure we get the usual:
--
ddunbar@lordcrumb:tmp$ clang c.c
c.c:1:6: error: invalid token after top level declarator
int x
     ^
1 diagnostic generated.
--

 - No test case, not amenable to non-executable testing. :/

 - <rdar://problem/6945613>

llvm-svn: 74629
2009-07-01 19:14:39 +00:00
Daniel Dunbar 126b3a103e Driver: Add Source argument for Commands to hold the Action which caused a
Command to be generated, to support more advanced diagnostics.
 - No functionality change.

llvm-svn: 74627
2009-07-01 19:02:28 +00:00
Owen Anderson d9dd77ff6c Update for LLVMContext+Module change.
llvm-svn: 74615
2009-07-01 17:00:06 +00:00
Douglas Gregor c05d2a11d7 Two fixes to make Clang build on Visual C++ (again), from Alisdair Meredith.
llvm-svn: 74606
2009-07-01 15:12:53 +00:00
Steve Naroff 05efa97d38 Rework Sema::CheckConditionalOperands(). No functionality change.
This was necessary to simplify some other changes I'm making (wrt ObjC type cleanups).

The idea is to separate the constraint checks for block pointers, ObjC pointers, and C pointers (the previous code combined them into one clause).

Note: This routine will be further simplified when I integrate the ObjC type cleanups (forthcoming).
llvm-svn: 74604
2009-07-01 14:36:47 +00:00
Eli Friedman 2857ccbaa7 Fix for PR4192: fix the definition of int64_t on x86_64 Linux.
Note that I'm guessing that *BSD and Solaris do the same thing as Linux 
here, but it's quite possible I'm wrong; if the following testcase 
gives an error on x86-64 with gcc for any of those operating systems, please
tell me:

#include <stdint.h>

int64_t x; long x;

llvm-svn: 74583
2009-07-01 03:36:11 +00:00
Fariborz Jahanian 302bb6661f Patch to support optional nested-name-specifier in in ctor-initializer
list.

llvm-svn: 74571
2009-06-30 23:26:25 +00:00
Douglas Gregor a727cb98a4 Preliminary parsing and ASTs for template-ids that refer to function
templates, such as make<int&>. These template-ids are only barely
functional for function calls; much more to come.

llvm-svn: 74563
2009-06-30 22:34:41 +00:00
Fariborz Jahanian 7baa71e2dd More diagnostics related to initialization of direct bases
in ctor-initializer list.

llvm-svn: 74541
2009-06-30 17:34:52 +00:00
Zhongxing Xu d0a246fd08 add utility method.
llvm-svn: 74521
2009-06-30 11:52:40 +00:00
Zhongxing Xu 41bbd51c33 add utility methods.
llvm-svn: 74520
2009-06-30 11:50:39 +00:00
Chris Lattner d466ea1b08 Implement PR4175, catching some questionable comparisons. Patch by
David Majnemer!

llvm-svn: 74513
2009-06-30 06:24:05 +00:00
Argyrios Kyrtzidis cfbfe78e9e De-ASTContext-ify DeclContext.
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

llvm-svn: 74506
2009-06-30 02:36:12 +00:00
Argyrios Kyrtzidis e3d025995c Introduce DeclContext::getParentASTContext().
It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext.

llvm-svn: 74505
2009-06-30 02:35:38 +00:00
Argyrios Kyrtzidis ddcd132a5b Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.
Timings showed no significant difference before and after the commit.

llvm-svn: 74504
2009-06-30 02:35:26 +00:00