Commit Graph

7267 Commits

Author SHA1 Message Date
Zhongxing Xu
7be05ed6b8 Add region store model to path-sensitive testing.
llvm-svn: 58983
2008-11-10 09:43:12 +00:00
Zhongxing Xu
18d6fd45de Implement RegionStoreManager::RemoveDeadBindings(). This prunes several false warning caused by removal of symbolic constraints. Currently we just mark all symbols live. Further optimization for dead binding removal needed.
llvm-svn: 58982
2008-11-10 09:39:04 +00:00
Chris Lattner
b5d21a4d03 don't preserve names on IR instructions. This matches llvm-gcc's behavior and
speeds up the compiler by ~8% at -emit-llvm -O0.

llvm-svn: 58977
2008-11-10 06:31:46 +00:00
Chris Lattner
494e4a6e3e sort files add a missed header to the project.
llvm-svn: 58976
2008-11-10 06:31:19 +00:00
Chris Lattner
f61801403d Fix even more bugs in debug info support:
1. emit proper debug info for forward decls of structs.
2. emit DW_TAG_member nodes around members of a field like llvm-gcc does.

This slows down debug info generation, but is required for correctness.

llvm-svn: 58973
2008-11-10 06:10:01 +00:00
Chris Lattner
affb37337f reimplement debug info generation in terms of DebugInfo.h instead of
using MachineModuleInfo.  This runs at about the same speed as the old
code, but fixes a bunch of bugs and is simpler and shorter.

llvm-svn: 58971
2008-11-10 06:08:34 +00:00
Zhongxing Xu
1c31dbe417 Print integer value instead of raw pointer. This is a hack to be fixed by migrating the output in analyzer to llvm::raw_ostream.
llvm-svn: 58965
2008-11-10 05:00:06 +00:00
Chris Lattner
231f7bbdbe silence a warning from gcc.
llvm-svn: 58956
2008-11-10 03:00:37 +00:00
Argyrios Kyrtzidis
9e59b577d8 Introduce ScopedDecl::getLexicalDeclContext() which is different from ScopedDecl::getDeclContext() when there are nested-names.
e.g.:
  namespace A {
    void f(); // SemanticDC (getDeclContext) == LexicalDC (getLexicalDeclContext) == 'namespace A'
  }
  void A::f(); // SemanticDC == namespace 'A'
               // LexicalDC == global namespace

llvm-svn: 58948
2008-11-09 23:41:00 +00:00
Argyrios Kyrtzidis
8ad00b26ee When a tag has nested-name ('struct foo::bar'), use not 'CurContext' but the context of the nested-name ('foo::').
llvm-svn: 58945
2008-11-09 22:53:32 +00:00
Argyrios Kyrtzidis
e02eb2bac2 Simplify handling of nested-names in tags ('struct foo::bar').
-Use more of the non nested-name code path.
-Also use the ActOnTagStruct code path.

llvm-svn: 58944
2008-11-09 22:09:58 +00:00
Anders Carlsson
3442f82c2f Support named operands in inline asm statements.
llvm-svn: 58940
2008-11-09 18:54:14 +00:00
Sebastian Redl
e0b2b1bf8c Update C++ status: class support improved due to nested name parsing.
llvm-svn: 58932
2008-11-09 11:32:32 +00:00
Argyrios Kyrtzidis
16ac9be7f0 Implement Sema support for C++ nested-name-specifiers.
llvm-svn: 58916
2008-11-08 17:17:31 +00:00
Argyrios Kyrtzidis
430a58edd8 Silence a GCC member initialization order warning.
llvm-svn: 58914
2008-11-08 16:47:38 +00:00
Argyrios Kyrtzidis
32a0379575 Implement support for C++ nested-name-specifiers ('foo::bar::x') in the Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.

llvm-svn: 58913
2008-11-08 16:45:02 +00:00
Argyrios Kyrtzidis
c7e67a04c3 Introduce annotation tokens, a special kind of token, created and used only by the parser to replace a group of tokens with a single token encoding semantic information.
Will be fully utilized later for C++ nested-name-specifiers.

llvm-svn: 58911
2008-11-08 16:17:04 +00:00
Sebastian Redl
f4485de48a Update C++ status to reflect parser capabilities for chapter 9 (classes). Slightly extend the class parser test.
llvm-svn: 58909
2008-11-08 15:40:37 +00:00
Sebastian Redl
2e133e47aa Update C++ status: dynamic_cast is sema-complete.
llvm-svn: 58907
2008-11-08 14:43:13 +00:00
Sebastian Redl
842ef52ff3 Move named cast helpers out of Sema, as Chris requested. This requirse making a few functions public that weren't before.
llvm-svn: 58906
2008-11-08 13:00:26 +00:00
Argyrios Kyrtzidis
0d9ee2eb2e Revert r58880, it breaks test/SemaCXX/constructor.cpp
llvm-svn: 58904
2008-11-08 12:02:25 +00:00
Argyrios Kyrtzidis
13042a4a4a Use only one constructor for CXXMethodDecl. Keep initialization stuff into one place.
llvm-svn: 58902
2008-11-08 11:24:06 +00:00
Daniel Dunbar
238475c8ca Avoid redundant cast<>s / simplify type dispatch.
llvm-svn: 58892
2008-11-08 06:12:46 +00:00
Daniel Dunbar
bbc0af7e37 Support getTypeInfo, getTypeAlign, getTypeSize on const Type*s.
- Size/align are not effected by CVR qualifiers.

Support getCanonicalType: const Type* -> const Type*.

llvm-svn: 58891
2008-11-08 05:48:37 +00:00
Daniel Dunbar
8ec8048f93 "Fix" PR3021, don't crash on generating record types when we can't
generate the type of a member.

llvm-svn: 58889
2008-11-08 04:42:29 +00:00
Daniel Dunbar
ad0a0f9cd2 Silence a gcc warning.
llvm-svn: 58888
2008-11-08 04:28:37 +00:00
Zhongxing Xu
3d43015bc7 Add a boilerplate for out-of-bound array checking. This has no real function currently.
llvm-svn: 58886
2008-11-08 03:45:42 +00:00
Argyrios Kyrtzidis
19b66a5e32 In a declarator, consider an identifier a constructor only if it is followed by '('.
Previously:

class C {
  int C;  // Declarator::SetConstructor was called here.
};

llvm-svn: 58880
2008-11-08 01:09:16 +00:00
Ted Kremenek
58b1c2d54a update post-build step
llvm-svn: 58878
2008-11-08 01:02:26 +00:00
Sebastian Redl
015085fafa Greatly improve static_cast diagnostics
llvm-svn: 58873
2008-11-07 23:29:29 +00:00
Douglas Gregor
a1f013e8ed Initial, partially-baked support for implicit user-defined conversions by conversion functions
llvm-svn: 58870
2008-11-07 22:36:19 +00:00
Cedric Venet
571c662350 Use css style instead of hard coded color in cxx_status. No visible change.
llvm-svn: 58867
2008-11-07 22:24:44 +00:00
Argyrios Kyrtzidis
e442635c37 Changes in preparation for nested-name-specifiers.
-When parsing declarators, don't depend on "CurScope->isCXXClassScope() == true" for constructors/destructors
-For C++ member declarations, don't depend on "Declarator.getContext() == Declarator::MemberContext"

llvm-svn: 58866
2008-11-07 22:02:30 +00:00
Ted Kremenek
47a6235491 Updated checker build.
llvm-svn: 58864
2008-11-07 20:55:59 +00:00
Douglas Gregor
60e64cfc43 Update C++ status
llvm-svn: 58862
2008-11-07 20:16:04 +00:00
Douglas Gregor
dbc5daf058 Parsing, ASTs, and semantic analysis for the declaration of conversion
functions in C++, e.g.,

  struct X {
    operator bool() const;
  };

Note that these conversions don't actually do anything, since we don't
yet have the ability to use them for implicit or explicit conversions.

llvm-svn: 58860
2008-11-07 20:08:42 +00:00
Argyrios Kyrtzidis
56fa31bc87 Assert that Parser::MaybeParseOperatorFunctionId is called when token is kw_operator, and replace ExpectAndConsume for the 'operator' token with a ConsumeToken.
llvm-svn: 58855
2008-11-07 15:54:02 +00:00
Douglas Gregor
450c75a15f Separate the parsing of type-specifiers from other declaration specifiers, so that we can parse a C++ type-specifier-seq
llvm-svn: 58854
2008-11-07 15:42:26 +00:00
Anders Carlsson
aaa183e944 include alloca.h instead of malloc.h. If this doesn't work for everyone we can just declare alloca directly in the file.
llvm-svn: 58853
2008-11-07 15:41:33 +00:00
Argyrios Kyrtzidis
a848ced426 Append the test runs with '&&'.
llvm-svn: 58851
2008-11-07 14:28:18 +00:00
Argyrios Kyrtzidis
3175fa5139 Properly deserialize ParamInfo of FunctionDecl.
When allocating an array for ParamInfo, the "decl->getNumParams()" call was used, but this will return 0 since it checks ParamInfo (which isn't yet defined and is null).
The result was that ParamInfo got an array of zero length to hold the ParmVarDecls.

llvm-svn: 58850
2008-11-07 14:22:23 +00:00
Argyrios Kyrtzidis
c118934d12 Bring in 'alloca' for the Analysis/stack-addr-ps.c test case.
llvm-svn: 58849
2008-11-07 14:00:25 +00:00
Zhongxing Xu
86d6d9b5bf Add simple get method.
llvm-svn: 58848
2008-11-07 13:13:41 +00:00
Zhongxing Xu
f66d0a187f Join two lines.
llvm-svn: 58847
2008-11-07 13:05:39 +00:00
Argyrios Kyrtzidis
6709e7d4cc Fix crash caused by this:
void f() {
   int +; // crash here
}

llvm-svn: 58846
2008-11-07 13:01:22 +00:00
Argyrios Kyrtzidis
f2ad9491f5 Shut off an unsigned/signed comparison warning for GCC.
llvm-svn: 58842
2008-11-07 12:15:16 +00:00
Zhongxing Xu
2c677c34d5 Finish the implementation of VisitCompoundLiteralExpr. As VisitInitListExpr is
available, things get much simplified.

One addition is that CompoundLiteralExpr can appear both in rvalue and lvalue
context.

llvm-svn: 58837
2008-11-07 10:38:33 +00:00
Zhongxing Xu
e79a4e667b Make the assertion real.
llvm-svn: 58833
2008-11-07 08:57:30 +00:00
Ted Kremenek
3391cb00fc Patch by Nikita Zhuk: Add TranslationUnitActions to AnalysisConsumer.
llvm-svn: 58831
2008-11-07 02:09:25 +00:00
Douglas Gregor
7d5fc7e28b Initial, rudimentary implementation of operator overloading for binary
operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.

The other kinds of overloadable operators in C++ will follow this same
approach. 

Three major issues remain:
  1) We don't find member operators
  2) Since we don't have user-defined conversion operators, we can't
  call any of the built-in overloaded operators in C++ [over.built].
  3) Once we've done the semantic checks, we drop the overloaded
  operator on the floor; it doesn't get into the AST at all.

llvm-svn: 58821
2008-11-06 23:29:22 +00:00