Граф коммитов

17189 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 6bc9768408 Fix a code gen. crash synthesizing a destructor.
Fixes pr5660.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90283 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:18:25 +00:00
Daniel Dunbar fbcc7bed1a In SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source locations with no common ancestor in the include stack, determine order by assuming memory buffers preceed files, and then that FileIDs are created in order.
The later assumption is patently false, but this was already broken -- this situation is conceptually impossible, my feeling is we should fix SourceManager and friends to make it impossible in practice as well. However, we need to fix PR5662 and perhaps some other things involving memory buffers first. In the short term I'm pretty sure this is reliable.

Chris, Argiris, is this going to break anything that wasn't already broken?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:07:57 +00:00
Ted Kremenek 9a0459c0f5 Added dead-stores test cases that involve the use of blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90277 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:04:14 +00:00
Chris Lattner 39d9841ed4 pass the reason for failure up from MemoryBuffer and report it
in diagnostics when we fail to open a file.  This allows us to
report things like:

$ clang test.c -I.
test.c:2:10: fatal error: error opening file './foo.h': Permission denied
#include "foo.h"
         ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:52:33 +00:00
Ted Kremenek 2b56b9cf74 Add new test case file that focuses on testing analyzer support for blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:47:46 +00:00
Eli Friedman 2b06d3485e Make EmitStoreOfScalar generate a more sane representation of boolean stores.
"Fixes" PR5645.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:31:51 +00:00
John McCall b1b425648c Fix IsProvablyNotDerivedFrom to always use record definitions when available.
Gets clang-on-clang passing again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:28:41 +00:00
Ted Kremenek 1488c7a098 The minimum element size in BumpVector should be 1, not 0.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:13:00 +00:00
Ted Kremenek 02b1df62ff Provide the correct vector size for referenced variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:12:34 +00:00
John McCall aa81e1658d Rework how we support C++ implicit member accesses. If we can resolve an
implicit member access to a specific declaration, go ahead and create
it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as
appropriate.  Otherwise, create an UnresolvedMemberExpr or
DependentScopeMemberExpr with a null base expression.

By representing implicit accesses directly in the AST, we get the ability
to correctly delay the decision about whether it's actually an instance
member access or not until resolution is complete.  This permits us
to correctly avoid diagnosing the 'problem' of 'MyType::foo()'
where the relationship to the type isn't really known until instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 22:10:20 +00:00
Daniel Dunbar fcb91afaf2 Add test case for PR5662.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 21:57:39 +00:00
Daniel Dunbar 64a32baec6 ASTUnit: Make sure to preserve the TargetInfo for later use.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 21:57:33 +00:00
Daniel Dunbar c4e265f67e Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 21:57:27 +00:00
Daniel Dunbar ec2a4ed278 Add {ExternalSemaSource,SemaConsumer}::ForgetSema callback, and update PCHReader
to use it so it at least won't try to access Sema once it is gone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 21:57:20 +00:00
Rafael Espindola 0259d20ba1 Exit the command line into <built-in> instead of going directly from the command line to the input file.
We passed <built-in> on the way in, so we should pass it again on the way out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 18:28:16 +00:00
Fariborz Jahanian 0e93d259ad (objc2 nonfragile-abi specific). If the translation unit includes an implementation
of a subclass (direct or indirect) of a weak_import root class, emit a weak reference 
for the root class's metaclass (should complete radar 6815425).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 18:25:24 +00:00
Ted Kremenek 43f19f779e Fix early-return logic in scanReachableSymbols() to match the rest of the recursive logic in the methods of ScanReachableSymbols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:50:25 +00:00
Daniel Dunbar 32d4d80c26 Convert Diagnostic::getCustomDiagID to take a StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90244 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:42:06 +00:00
Douglas Gregor e6342c0635 Funtion templates and function template specializations do not
override virtual functions. Also, eliminate a (now redundant) call to
AddOverriddenMethods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:35:23 +00:00
Douglas Gregor 4ba3136b3e Move the checking of overridden virtual functions into the code path
common to both parsing and template instantiation, so that we'll find
overridden virtuals for member functions of class templates when they
are instantiated. 

Additionally, factor out the checking for pure virtual functions, so
that it will be executed both at parsing time and at template
instantiation time. 

These changes fix PR5656 (for real), although one more tweak
w.r.t. member function templates will be coming along shortly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 17:24:26 +00:00
Douglas Gregor 9af2f52fbc Don't automatically assume that an id-expression refers to a
ValueDecl, because that isn't always the case in ill-formed
code. Diagnose a common mistake (forgetting to provide a template
argument list for a class template, PR5655) and dyn_cast so that we
handle the general problem of referring to a non-value declaration
gracefully.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 16:58:18 +00:00
Douglas Gregor d3a505827f An inherited virtual (where "virtual" wasn't written explicitly) can
be defined as pure. Fixes PR5656.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90237 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 16:18:00 +00:00
Nuno Lopes 360f075fc6 fix build on linux
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 12:49:04 +00:00
Daniel Dunbar 521bf9c529 Add ASTUnit::LoadFromCompilerInvocation, which does what it says.
Also, add an -ast-from-source option to index-test which allows index-test to
run on source files directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90223 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 09:51:01 +00:00
Kovarththanan Rajaratnam d8fdde1196 Tuck away scan-build related files into tools/scan-build
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:52:01 +00:00
Kovarththanan Rajaratnam e1fea772c4 Move ubiviz to analyzer directory
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 06:34:06 +00:00
Douglas Gregor 2b4074f1d3 Switch the clang-to-CIndex interface for code-completion to a binary format, for a massive speedup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 05:55:20 +00:00
Eric Christopher 91b5927443 Update for llvm intrinsics change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 05:00:51 +00:00
Mike Stump 0f590be380 Much work on try/catch statement. WIP.
Highlights include:

  Fix __cxa_begin_catch so it now returns a value.
  Added getUnwindResumeOrRethrowFn helper to build up calls to
  _Unwind_Resume_or_Rethrow.
  Broke out object copying code into CopyObject from EmitCXXThrowExpr.
  Built up another version of CopyObject that can copy from memory for
  use in the catch parameter code.
  RTTI generation for type matching for catch.
  Code to check for the type match for catch.
  Code to generate the catch parameter, WIP, need make sure references
  and pointers and copy ctors work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90205 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:41:18 +00:00
Douglas Gregor 958aeb04f4 Eliminate warning in Release-Asserts mode. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90204 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:34:29 +00:00
Daniel Dunbar 56ac85c4fd clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
where it belongs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:16:53 +00:00
Daniel Dunbar ebe6862e34 Add a very minimal README.txt for examples/PrintFunctionNames.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:15:49 +00:00
Daniel Dunbar 9ebfa31222 CIndex: Normalize formatting some more.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:14:51 +00:00
Zhongxing Xu f99ce1e81f Clean up BuiltinBug class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90195 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 03:06:19 +00:00
Daniel Dunbar 625e4efc2c c-index-test: Split "function scanning" behavior into its own "filter" -- its
quite slow and doesn't really stress the APIs people should really use.
 - I'm not even sure if this mode is still useful given the other scanning mode;
   Steve?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 02:35:37 +00:00
Daniel Dunbar ada487d498 Add c-index-test -test-load-source, which loads the translation unit from a source file (and other command line arguments).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 02:03:10 +00:00
Ted Kremenek 94a39005e3 Allocate MultipleDC objects using the allocator associated with
ASTContext instead of malloc.  Besides reducing malloc traffic, this
also removes a source of memory leaks when using a BumpPtrAllocator
for the allocator of ASTContext.  There are still leaks when using
MallocAllocator because Decl::Destroy() isn't fully finished.

Fixes: <rdar://problem/7431556>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 00:07:10 +00:00
John McCall e1599cee93 Fix and test for a problem caught by the clang-on-clang buildbot: qualified
IDs in dependent contexts are not dependent if the context names a namespace.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 23:50:49 +00:00
Anders Carlsson 1a5e0d7f18 Have ASTRecordLayout keep track of the key function, in preparation of fixing a synthetic ctor/dtor bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 23:41:22 +00:00
John McCall 7dafdf5117 Remove all of Sema's explicit uses of OverloadedFunctionDecl except for
those associated with TemplateNames.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90162 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 22:55:35 +00:00
John McCall 129e2df52e Eliminate the use of OverloadedFunctionDecl in member expressions.
Create a new UnresolvedMemberExpr for these lookups.  Assorted hackery
around qualified member expressions;  this will all go away when we
implement the correct (i.e. extremely delayed) implicit-member semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90161 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 22:42:35 +00:00
Fariborz Jahanian abce6999b2 Test for my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 22:07:56 +00:00
Fariborz Jahanian ba2253f234 More support for virtual destructor calls.
Fixes pr5619


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 22:07:18 +00:00
Anders Carlsson 3790980841 When we're trying to define an implicit virtual destructor, make sure that we have a valid delete operator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90156 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 21:24:50 +00:00
Daniel Dunbar acca725aef Reindent buffer, switches in particular were totally out of style.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90155 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 20:42:49 +00:00
Daniel Dunbar 0d7dd22238 Strip trailing space.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 20:42:43 +00:00
Mike Stump 6515afe50c Add const to accessors that don't modify the object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 20:10:58 +00:00
Mike Stump f71d232ce5 Reflow comments and fix 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 20:08:49 +00:00
Daniel Dunbar 30e682e1ef Add missing assignment operator to test, and add tests for while loops and for
loops (including temporaries inside the initializers).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 20:00:35 +00:00
Anders Carlsson 0121fbdee1 Fix an assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90149 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 19:43:26 +00:00