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

10617 Коммитов

Автор SHA1 Сообщение Дата
Benjamin Kramer b2041de2eb Don't call back() on an empty vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 22:16:51 +00:00
Steve Naroff b85e77af05 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71225
http://llvm.org/viewvc/llvm-project?view=rev&revision=73207
http://llvm.org/viewvc/llvm-project?view=rev&revision=73414



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 21:43:12 +00:00
Anders Carlsson bb27d868ac CodeGenModule::GenerateVtable now returns a pointer directly to the vtable and not to the address point.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 21:28:12 +00:00
Anders Carlsson e40477cd57 Make sure that hte vtable always has an i8* array type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 21:09:05 +00:00
Anders Carlsson 9ac95b99ac Add a function for getting the vtable address point of a class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 21:03:56 +00:00
Anders Carlsson 4282edfe69 Simplify BuildVTT.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 21:02:25 +00:00
Anders Carlsson 2e32aaef37 Let the VTT builder pretend that getVtable returns a pointer to the vtable and not to the vtable address point.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 20:58:49 +00:00
Anders Carlsson be58b390eb Change getCtorVtable to not return the address point offset, but the global variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 20:42:53 +00:00
Anders Carlsson 9428b67b06 Simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 18:38:15 +00:00
Anders Carlsson 7ca4643663 Factor vtable related GlobalVariable creation out into a separate function. Add vtable linkage test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 17:04:47 +00:00
Steve Naroff 3d7e7865bd Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71086
http://llvm.org/viewvc/llvm-project?view=rev&revision=71107

Note: This fixes <rdar://problem/6845623> from protocol to template.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 15:55:59 +00:00
Steve Naroff 0304c6cb7f Remove 'LangOpts' from Diagnostic (added in http://llvm.org/viewvc/llvm-project?view=rev&revision=90642).
Simply use the 'LangOpts' member already present in TextDiagnosticPrinter.

Sorry for the confusion!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 12:23:07 +00:00
Benjamin Kramer 0e7049fc6f Avoid trashing two temporary strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 10:22:15 +00:00
Benjamin Kramer f42d4886ae strcasecmp is unportable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 10:07:04 +00:00
Douglas Gregor 2b0cc12cf1 Improve the performance of code completion by 2.2x when completing for ordinary names with Cocoa.h included, by drastically improving the performance of our results sorting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 09:08:56 +00:00
Chris Lattner 761acc19d9 implement rdar://7346691 by codegen'ing struct/array initializers
to a memset or a memcpy from a global when possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90658 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 08:22:11 +00:00
Chris Lattner 10976d99e4 various cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 08:21:30 +00:00
Chris Lattner ff933b7097 simplify a condition and add a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 06:49:57 +00:00
Chris Lattner 02dd4b1e27 fix rdar://7446395, a crash on invalid, by fixing a broken assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90647 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 05:40:13 +00:00
Eli Friedman 378fe06b93 Tweak "key function" rules so that they work for templates with virtual
inline functions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 04:55:55 +00:00
Steve Naroff e0c4d895ff Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71086

Note - This commit only includes the fix for:

<rdar://problem/6309338> slightly different error message format for Visual Studio.

The fix for <rdar://problem/6845623> from protocol to template. is separate/forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 02:14:08 +00:00
Eli Friedman 152b5b1326 Skip actually generating the vtable unless we are defining it. This avoids
the side-effects of generating the methods in the vtable (including PR5676).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90635 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 01:05:03 +00:00
Daniel Dunbar f5431e3563 Unbreak -ccc-cxx and -ccc-clang-cxx defaulting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:13:59 +00:00
Anders Carlsson 1b3171dd6c Don't emit explicit specializations of static member variable declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90624 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 23:50:01 +00:00
Mike Stump 6a1e0eb557 Add support for function try blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 23:26:17 +00:00
John McCall ed97649e95 Fix "using typename" and the instantiation of non-dependent using declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:46:56 +00:00
Benjamin Kramer cce9fde82a Return bool as a bool instead of a uint64_t.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:45:27 +00:00
Anders Carlsson 48eda2c5d6 Be a little more clever about inline member functions that are marked inline in the inline class declaration but not in the actual definition:
class A {
  inline void f();
}

void A::f() { }

This is not the most ideal solution, since it doesn't work 100% with regular functions (as my FIXME comment states).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90607 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:35:50 +00:00
Anders Carlsson 5c478cf2d5 Diagnose declarations of implicit member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:33:25 +00:00
Daniel Dunbar 8477ee93c9 Driver: Switch -ccc-* options to using the standard options functionality.
- I still want to get rid of them, but manually handling them isn't adding value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:55:23 +00:00
John Thompson 6e132aab86 Fix for PR5650 - Revised vector_size attribute handling to be done earlier before declaration is finalized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:51:28 +00:00
Steve Naroff 17c8778db9 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70978



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:36:32 +00:00
Steve Naroff fdd6aaf162 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70926



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:29:41 +00:00
Steve Naroff e89b8e7946 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70922



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:18:19 +00:00
Sean Hunt 5dd6b39fb5 Put in FIXME that this mangling is not official in.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:11:13 +00:00
Daniel Dunbar 2658f05caf OptTable: Allow option groups to be used to define "help groups", which will
collate the options inside that group.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:08:40 +00:00
Daniel Dunbar 9a242512a8 OptParser: Add HelpHidden flag.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:08:25 +00:00
Sean Hunt 2421f66b94 Switch mangling of literal operator names to a string that's
a) legal
 b) likely to be chosen as the official mangling

This will break ABI compatibility with all literal operator names,
so you may need to recompile any such code. Sorry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90587 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:01:37 +00:00
Mike Stump 1c4269a9d9 Be sure to instantiate rtti for non-polymorphic bases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 20:55:13 +00:00
Ted Kremenek 30a45344c8 Teach AnalysisContext::getBody() about BlockDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 20:34:55 +00:00
Ted Kremenek 4f1db53772 Teach 'ExecutionContinues' (part of BugReporter's diagnostic generation) about BlockDecls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 20:34:31 +00:00
Ted Kremenek 224451bf4e Include BlockDeclRefExprs in constructed CFGs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 20:33:25 +00:00
Ted Kremenek edeb5b6b50 Replace SymbolReaper::isLive(VarDecl) with SymbolReaper::isLive(VarRegion).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 20:32:20 +00:00
Anders Carlsson fd12649cd5 When generating a virtual destructor, don't try to make a virtual call to the base class destructor because then we'll just re-enter the same destructor!
This was done to fix PR5619, so I went ahead and passed a dummy VTT pointer for now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 19:33:17 +00:00
Rafael Espindola 0f4c59c3be Add gcc's -no-canonical-prefixes option to clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 19:31:58 +00:00
Mike Stump b2c9c0b1c5 Fixup nested try blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 19:21:57 +00:00
Mike Stump a086783570 Fix warning and be sure to set up the rethrow pointer if we fall off
the end of all the catches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90574 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 19:03:47 +00:00
Anders Carlsson ac3f7bdb26 Rename 'Class' to 'MostDerivedClass'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 18:36:22 +00:00
Anders Carlsson a22fd857d3 Store the vtable components in a SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 16:24:46 +00:00
Anders Carlsson 9d4dd3e3e3 Use a different ConstantArray::get.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 16:22:27 +00:00
Anders Carlsson 15318f4762 Move the vtable vector directly into the Vtable builder.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 16:19:30 +00:00
Anders Carlsson 77c23e5a49 Change getIndex to return false if the index wasn't found. Avoids an extra hash lookup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90568 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 15:49:02 +00:00
Eli Friedman dfe33bbd41 Minor cleanup; no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90565 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:52:11 +00:00
Eli Friedman 367d122365 Remove unused argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:40:51 +00:00
Eli Friedman ca9b56c26a Eliminate submethods vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:36:58 +00:00
Eli Friedman 4714583d5a Eliminate the inner loop in VtableBuilder::OverrideMethod.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:34:14 +00:00
Daniel Dunbar 125bbbe648 PR5684: Fix refacto, the backend consumer was copying the Diagnostic object,
which meant that hasErrorOccurred() checks to prevent codegen-on-invalid weren't
working.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:17:40 +00:00
Daniel Dunbar f772d1e2a5 ASTUnit/CIndex: Explicitly track the top-level decls when using an ASTUnit made
from a source file.
 - This allows CIndex to avoid iterating over all the top-level decls when using
   a PCH, which means we deserialize far fewer decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:17:33 +00:00
Eli Friedman 16c5378c1e Make sure to call PerformObjectMemberConversion where necessary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 07:18:51 +00:00
Chris Lattner 2e77aa1c2a Use PresumedLoc when emitting the 'included from' diagnostics. For a malformed
test like this:

#line 4 "foo"

#define XX ?

#if XX
#endif

We now emit:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
    ^
foo:5:12: note: instantiated from:
#define XX ?
           ^

instead of:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
    ^
./t.h:6:12: note: instantiated from:
#define XX ?
           ^

(where the note doesn't obey #line or print the include stack when needed).

This fixes PR5617



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 07:06:35 +00:00
Ted Kremenek bfb4fc9ebc Rename instance variable to avoid name conflict with parameters, and modify addTransition() to compare the correct state values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:57:49 +00:00
Eli Friedman dd27a2d390 Missed change from last commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:46:54 +00:00
Eli Friedman f595cc41c4 Make the type of the Decl referred to by a MemberExpr a bit more precise.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:40:45 +00:00
Anders Carlsson 47846d2b4c Correctly mangle the 'std' namespace inside extern "C++" blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90544 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:23:23 +00:00
Chris Lattner 04f2bd859b minor tidy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90543 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:14:03 +00:00
Anders Carlsson 3aaf486af6 Make sure that overridden method decls are always canonical.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 05:51:56 +00:00
Eli Friedman 8b9006f4e8 Fix regression in vtable improvements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90540 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 04:30:03 +00:00
Mike Stump fffefeb8ec Try/catch statements seem to be working well enough to turn on.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:57:07 +00:00
Mike Stump ce0339032a Disable for now, doesn't play nice with the temporary code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:55:53 +00:00
Eli Friedman d6a3e67f37 Rename method to something easier to search for.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90536 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:54:56 +00:00
Anders Carlsson dd454bee6b More work in preparation of getting rid of the submethods loop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:52:52 +00:00
Anders Carlsson 0e881169af Remove an unused member variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90534 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:46:21 +00:00
Anders Carlsson c0c4993d1c Add a way to get the index of a method. Assert that we have the same index for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90533 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:41:37 +00:00
Anders Carlsson 29202d5065 Add a premature optimization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:07:26 +00:00
Anders Carlsson 2fce216955 Add the method directly to the vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 03:06:03 +00:00
Anders Carlsson 1e2180bf32 Get rid of the PureVirtualMethods map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:58:12 +00:00
Anders Carlsson bf54027d27 Move handling of pure virtual methods to AppendMethods (and rename it to AppendMethodsToVtable).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:56:03 +00:00
Anders Carlsson ea357223e5 Move covariant thunk handling to AppendMethods too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:52:22 +00:00
Anders Carlsson b73ba39f38 Move 'this' pointer adjustment thunks to AppendMethods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90527 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:43:50 +00:00
Eli Friedman b17daf9ab7 Make functions returning a struct indirectly evaluate the returned struct
directly into the sret pointer. This is an optimization in C, but is required
for correctness in C++ for classes with a non-trivial copy constructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:43:40 +00:00
Anders Carlsson adfa26773c Factor appending methods to a vtable out into a separate function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:39:04 +00:00
Anders Carlsson 98fdb24687 Get rid of the Thunks struct too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:26:15 +00:00
Anders Carlsson a875670a66 Remove the CovariantThunk struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:22:02 +00:00
Anders Carlsson 4644b8bb2c Remove the GlobalDecl from the Thunk as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:14:12 +00:00
Eli Friedman 67f85fcdab Fix for PR5447: teach Evaluate to deal with floating-point conditionals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:12:53 +00:00
Anders Carlsson c71a5234c0 Remove the GlobalDecl from the CovariantThunk struct, we can just look it up in the Methods table now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:11:21 +00:00
Anders Carlsson a7f1911db2 Start populating the VtableMembers structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:08:24 +00:00
Ted Kremenek d02e83a548 Allow BlockInvocationContext to wrap either a BlockDecl* or a BlockDataRegion*, giving us choice in our degree of context-sensitivity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:03:51 +00:00
Anders Carlsson c7ab1a8dfc Add a data structure for efficient storing of vtable methods. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90515 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 02:01:07 +00:00
Mike Stump 0a3816e566 Fixup reference binding for catch parameters.
Fixup throws and rethrows to use invoke as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:51:45 +00:00
Eli Friedman 13a5be10b1 Update chunk of #if 0'ed code to remove fixed FIXME and make it compile. We
probably want to do some sort of performance assessment before enabling it,
though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:30:56 +00:00
Ted Kremenek 0ee4124012 Refactor LocationContext creation logic into a single member template.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 01:28:56 +00:00
Ted Kremenek dc0d909f0f Refactor FoldingSet profiling code for LocationContexts, and add a new BlockInvocationContext to represent the invocation of a block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:50:10 +00:00
Eli Friedman 9aef7263d8 Fix for PR5679: make __builtin_prefetch a bit more flexible in what it accepts
as a constant integer.  Also, some minor cleanup and improvements to the
diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:30:06 +00:00
Ted Kremenek b48ad64a0e constify MemRegion* returned by MemRegionManager::getXXXRegion() methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:26:31 +00:00
John McCall 5023437f5a When recovering from an invalid forward reference to an enum type in C++,
create the enum type in the same scope as you would a record type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:07:04 +00:00
Ted Kremenek bcd7f9f8cb More template-logic for MemRegion construction out of MemRegion.h and into MemRegion.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90499 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 00:05:57 +00:00
Mike Stump 3faae56c3b These are done.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 22:55:42 +00:00
Mike Stump d9cb7e9732 Improve catch parameter bindings for scalar non-pointers. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 22:38:15 +00:00
John McCall d001454000 Lift the ObjCPropertyCallback out of local scope to unbreak VS2005 builds.
Make it an inner class of Parser to assuage access control.
No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90491 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 22:31:13 +00:00
Eli Friedman c013118155 Add recursion guards to ice-checking and evaluation for declrefs, so we
don't infinitely recurse for cases we can't evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90480 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 20:31:57 +00:00
Ted Kremenek f722770952 Try to make the output of PlistDiagnostics more deterministic by sorting PathDiagnostics before they are emitted. Fixes <rdar://problem/7439668>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 19:35:02 +00:00
Fariborz Jahanian e7184df728 A new helper function to set various bits in the class when
a new virtual function is declared/instantiated. it is used
in couple of places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90470 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 18:44:40 +00:00
Daniel Dunbar ba8d86172c Fix Clang tool translation to forward -fvisibility as separate arguments, the
old syntax isn't supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 18:42:11 +00:00
Douglas Gregor 1ab537be68 Unify the end-of-class code paths used by the parser and template
instantiation, to ensure that we mark class template specilizations as
abstract when we need to and perform checking of abstract classes.

Also, move the checking that determines whether we are creating a
variable of abstract class type *after* we check whether the type is
complete. Otherwise, we won't see when we have an abstract class
template specialization that is implicitly instantiated by this
declaration. This is the "something else" that Sebastian had noted
earlier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 18:33:45 +00:00
Anders Carlsson 51f940457a When instantiating a class, if a base specifier is not dependent we still need to copy its attributes down to the instantiated class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90463 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 17:49:57 +00:00
Ted Kremenek a7a8dfd702 Tweak handling of BlockDataRegions in RegionStoreManager::RemoveDeadBindings(): only the VarRegions for variables marked with the '__block' annotation should have their lifetime extended by a BlockDataRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 17:48:05 +00:00
Anders Carlsson 7b0ca3fa6f Handle static_assert inside functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 17:26:31 +00:00
Douglas Gregor 1f5f3a4d58 When we're building a CXXExprWithTemporaries, only include those
temporaries that are within our current evaluation context. That way,
nested evaluation contexts (e.g., within a sizeof() expression) won't
see temporaries from outer contexts. Also, make sure to push a new
evaluation context when instantiating the initializer of a variable;
this may be an unevaluated context or a potentially-evaluated context,
depending on whether it's an in-class initializer or not. Fixes PR5672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 17:10:37 +00:00
Douglas Gregor 109ae73ec7 Minor cleanup to the code-completion-point logic suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 17:05:59 +00:00
Mike Stump c085a981ce Eli, I copied my code from this code... Let's fix the souce of the bad idea!
Thanks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 16:55:20 +00:00
Eli Friedman 4a2251bb06 Fix for PR5659: correct a rather nasty oversight in the type conversion for
member pointer types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 12:44:31 +00:00
Zhongxing Xu 1bf405666c Add security syntactic checker for mktemp.
Patch by Lei Zhang!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:15:23 +00:00
Daniel Dunbar 459cc2387e Update CMake for CallGraph.cpp move.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:14:19 +00:00
Daniel Dunbar baac10380c Fix two more diagnostic-on-stderr instances that thought they could hide from me -- they thought wrong.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:14:12 +00:00
Daniel Dunbar e7cb7e4570 Kill a few more random stderr uses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90441 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:14:02 +00:00
Daniel Dunbar 28df7a5813 Convert ABIArgInfo::dump to raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:49 +00:00
Daniel Dunbar 33671988f1 Use llvm_report_error instead of fprintf + assert + exit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:36 +00:00
Daniel Dunbar 360435908c Fix CompilerInstance::createOutputFile to use proper diagnostics, and (try to) update all clients to be able to handle failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:30 +00:00
Daniel Dunbar 43adb7e9e9 Remove an unnecessary (I believe) exit() on error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:19 +00:00
Daniel Dunbar 806c12e64c Convert StmtDumper to raw_ostream. I forget why.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:13 +00:00
Daniel Dunbar 93ebb1ba9f Switch PCHReader::getOriginalSourceFile to use proper diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:06 +00:00
Daniel Dunbar 3be0d19503 Fix BackendConsumer to use proper diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:12:54 +00:00
Ted Kremenek 2ffbfd96a3 Add value invalidation logic for block-captured variables. Conceptually invoking a block (without specific reasoning of what the block does) can invalidate any value to it by reference when the block was created.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 08:25:47 +00:00
Ted Kremenek 81cef58890 Make BlockDataRegion::referenced_vars_iterator an actual class that enforces that all MemRegions iterated over are VarRegions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 08:09:21 +00:00
Anders Carlsson 08a87f4a75 Attempt to fix the MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:30:40 +00:00
Daniel Dunbar 8fd57fea85 Fix layering violation by moving Analysis/CallGraph to Index
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:20:04 +00:00
Daniel Dunbar 9b5e9ae08d clang-cc: Honor -help and -version when using new style option parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:01:58 +00:00
Daniel Dunbar 60e107fb86 Add OptTable::PrintHelp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:01:38 +00:00
Daniel Dunbar e14b5f5237 Add clang -cc1 support for -remap-file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 05:11:16 +00:00
Daniel Dunbar efba227cc5 Add clang -cc1 -load option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 05:11:05 +00:00
Eli Friedman 6804fa27eb Fix thunk generation for thunks with a parameter with reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 04:49:52 +00:00
Eli Friedman 35c98cc4c0 Minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 04:27:05 +00:00
John McCall 701c89e02c Honor using declarations in overload resolution. Most of the code for
overloaded-operator resolution is wildly untested, but the parallel code for
methods seems to satisfy some trivial tests.

Also change some overload-resolution APIs to take a type instead of an expression,
which lets us avoid creating a spurious CXXThisExpr when resolving implicit
member accesses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 04:06:58 +00:00
Mike Stump 919d5e51fd Add support for thunking dtors. Oh why does this make my head hurt?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 03:47:56 +00:00
Mike Stump f668bd0e05 Reflow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 03:40:14 +00:00
Anders Carlsson 1750b4f1bd Revert r90402 for now, virt.cpp is failing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 03:28:24 +00:00
Ted Kremenek 81a9583668 Add batch version of 'StoreManager::InvalidateRegion()' for invalidating multiple regions as once. After adopting this in the CFRefCount::EvalCall(), we see a reduction in analysis time of 1.5% when analyzing all of SQLite3.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 03:27:11 +00:00
Anders Carlsson b5b32f5292 Use Eli's ComputeThunkAdjustment for calculating the return adjustment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 03:15:31 +00:00
Anders Carlsson 9fcfc421d3 Add CodeGenModule::ComputeThunkAdjustment, which Eli wrote.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 03:06:55 +00:00
Anders Carlsson 3b908ce403 Remove the index from the Thunk struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:41:55 +00:00
Anders Carlsson 491b95577b Change the Thunks map to use the vtable index as the key.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:39:59 +00:00
Anders Carlsson 6fd247bf89 Add the global decl to the Thunk struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90398 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:36:40 +00:00
Anders Carlsson 1345f4aa9c Remove unused struct fields.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:34:59 +00:00
Anders Carlsson 891bb4b6a5 Delay computing the return adjustments for covariant thunks until when they are added to the vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:32:59 +00:00
Anders Carlsson bc0e3396c4 No need to create the covariant thunk in both places now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90394 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:22:59 +00:00
Anders Carlsson 1db4a9b11b Whoops, forgot to save :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:20:26 +00:00
Anders Carlsson 5f96bc1281 Remove the index field from the CovariantThunk structure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:16:14 +00:00
Anders Carlsson d6f7af5087 Change the CovariantThunk map to use the vtable index as its key.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:12:03 +00:00
Anders Carlsson bdd8e38385 Store a GlobalDecl in the return adjustment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:03:29 +00:00
Anders Carlsson d8ddffc6d1 Do not include the 'this' pointer adjustment in the covariant return type. Instead, store it in the (now oddly named) Thunks map.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:58:20 +00:00
Anders Carlsson 27682a3e93 Move VtableBuilder::OverrideMethod out of line in preparation of other changes to it. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:54:02 +00:00
Daniel Dunbar 5262fda30b Fix ASTUnit to allows require a (persistent) Diagnostic object be provided; propogate and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:45:44 +00:00
Ted Kremenek 7d9bd4257f Add 'has_feature(cxx_exceptions)' to allow code to determine via preprocessor logic if C++ exceptions are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:34:15 +00:00
Mike Stump 6b85fa4121 Remove untrue statement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:34:13 +00:00
Ted Kremenek 2eca546c58 Rename has_feature(rtti) to has_feature(cxx_rtti) for clarity.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90376 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:31:28 +00:00
Mike Stump 7087d75db1 Note a failure I saw from the g++ testsuite:
FAIL: g++.old-deja/g++.mike/eh23.C (test for excess errors)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:22:05 +00:00
Ted Kremenek 848001c0cd Add "has_feature" support for C++ RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:02:35 +00:00
John McCall fda8e12774 Stop stripping UnresolvedUsingDecls out of LookupResults that have other
results in them (which we were doing intentionally as a stopgap).  Fix
an DeclContext lookup-table ordering problem which was causing UsingDecls to
show up incorrectly when looking for ordinary results.  And oh hey
Clang-Code-Syntax passes now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:58:24 +00:00
Ted Kremenek 74635d8cd3 Add a heuristic to the dead stores checker to prune dead stores for variables annotated with '__block'. This is overly conservative, but now the analyzer doesn't report dead stores for variables that can be updated by a block call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:46:16 +00:00
Sebastian Redl ccf43505db Introduce the notion of literal types, as specified in C++0x.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:13:20 +00:00
Eli Friedman 61d89b61d4 Work-in-progress: teach mangler how to mangle thunks for destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 00:03:05 +00:00
Mike Stump be7c144fcb Cleanups on exceptional edges don't work at all, yet. This doesn't
catch very many of them and if we caught all of them, the errors would
be annoying.  I'm working on this next.  WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 23:46:02 +00:00
Mike Stump f7f74675d4 Add a cleanup scope for each catch clause.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 23:37:16 +00:00
Mike Stump 730203088e Add missing branch to exit. Seemingly obvious when I look at the
code, but to track this down was laborious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 23:28:08 +00:00
Douglas Gregor 802ab45fea Improve source location information for C++ member initializers in a
constructor, by keeping the DeclaratorInfo* rather than just the type
and a single location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 22:36:29 +00:00
Daniel Dunbar c7822dbf3c ASTUnit: Explicitly track whether the ASTUnit came from an actual AST or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 21:47:43 +00:00
Daniel Dunbar 68ea2ac7fd ASTUnit: Fix initialization of OnlyLocalDecls variable, and honor UseBumpAllocator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 21:47:32 +00:00
Eli Friedman 7facf8408f Fix for PR5522 and PR5666: fix a bunch of mangling issues with extern variables
and funcctions declared locally within a function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 20:32:49 +00:00
John McCall 144238edd9 Use a more rigorous definition of 'class member'. I don't have any evidence
that this was causing a problem, but it could have.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 20:26:00 +00:00
John McCall 336e7743b8 Recognize that EnumConstantDecls can be found by lookup and are not instance
members.  Fixes PR5667.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 19:59:55 +00:00
Mike Stump 639787c8e9 Pull the terminate handler up so that we can use it for the catch
parameter setup code and set up the catch parameter setup code to
protect that code with terminate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 19:53:57 +00:00
Mike Stump 79336285af Turn off for now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 19:50:41 +00:00
Mike Stump 92f2fe2541 Put the Builder classes into the anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 19:07:44 +00:00
Mike Stump de05057932 Change rtti/Rtti to RTTI, as it is an acronym.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:57:08 +00:00
Mike Stump 0cb6c19e46 Rename CGRtti.cpp to CGRTTI.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90331 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:32:08 +00:00
Mike Stump c88b6735ea Avoid warning for getTerminateFn defined but not used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90330 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:20:18 +00:00
Douglas Gregor 057e567f1b Extend -remap-file=from;to to permit mapping from a non-existent
file. This is accomplished by introducing the notion of a "virtual"
file into the file manager, which provides a FileEntry* for a named
file whose size and modification time are known but which may not
exist on disk.

Added a cute little test that remaps both a .c file and a .h file it
includes to alternative files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:12:28 +00:00
Anders Carlsson 5ec02ae147 In Sema, whenever we think that a function is going to cause a vtable to be generated, we mark any virtual implicit member functions as referenced.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90327 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 17:15:43 +00:00
Douglas Gregor 2973c0eff4 Move file-remapping logic into InitPreprocesor. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 16:32:41 +00:00
John McCall 51fa86f738 r90313, in which OverloadedFunctionDecl is removed and never spoken of again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90313 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:47:38 +00:00
Daniel Dunbar 68d40e2d16 Fix ASTUnit::getOriginalSourceFileName() when using ASTUnit's derived from
source files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90311 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:44:16 +00:00
Daniel Dunbar cb6dda1a7a ASTUnit: Don't create an LLVMContext, it shouldn't be needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:43:56 +00:00
John McCall 1bcee0a5a2 Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:
LookupResult::getAsSingleDecl() is no more.  Shift Sema::LookupSingleName to
return null on overloaded results.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:25:40 +00:00
Mike Stump 666571afad terminate doesn't throw.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:18:09 +00:00
Douglas Gregor 716f0b3e2e Introduce a new clang-cc option
-remap-file=from;to

which takes the file "from" and transparently replaces its contents
with the contents of the file "to" from the source manager's
perspective. This is the moral equivalent of

  cp from saved
  cp to from
  <call clang>
  cp saved from
  rm saved

without all of the pesky file copying.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:08:39 +00:00
John McCall 0bd6feb9e9 Push overloaded function templates through the parser using a totally different
leaked data structure than before.  This kills off the last remaining 
explicit uses of OverloadedFunctionDecl in Sema.                                         


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:04:21 +00:00
Mike Stump 99533834ba More exception handling improvements... WIP.
Highlights include:

  Add a helper to generate __cxa_free_exception and _ZSt9terminatev.
  Add a region to handle EH object deallocation for ctor failures for throw.
  Add a terminate handler for __cxa_end_catch.
  A framework for adding cleanup actions for the exceptional edges only.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 07:41:41 +00:00
Eli Friedman 5fcf1f0df0 Fix another "operator delete missing" crash: make sure we don't check
isVirtual() before we've actually calculated whether the destructor is
virtual.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 07:16:50 +00:00
Eli Friedman ca6affd016 Make sure to call AddOverriddenMethods for implicit copy assignment operators;
it's rare, but possible, for the difference to be significant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90301 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 06:59:20 +00:00
Douglas Gregor 2968442603 Extend the source manager with the ability to override the contents of
files with the contents of an arbitrary memory buffer. Use this new
functionality to drastically clean up the way in which we handle file
truncation for code-completion: all of the truncation/completion logic
is now encapsulated in the preprocessor where it belongs
(<rdar://problem/7434737>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90300 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 06:49:09 +00:00
Zhongxing Xu a46e4d91d8 Hard bifurcate the state into nil receiver and non-nil receiver, so that
we don't need to use the DoneEvaluation hack when check for 
ObjCMessageExpr.

PreVisitObjCMessageExpr() only checks for undefined receiver or arguments.

Add checker interface EvalNilReceiver(). This is a 'once-and-done' interface.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 05:49:12 +00:00
Douglas Gregor 4a160e16eb Eliminate the unnecessary FirstFID cache variable from the source manager's ContentCache
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 05:34:39 +00:00
John McCall 2f841ba3b3 Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;
there's nothing interesting we can say now that we're correctly not requiring
the qualifier to name a known base class in dependent contexts.

Require scope specifiers on member access expressions to name complete types
if they're not dependent;  delay lookup when they are dependent.

Use more appropriate diagnostics when qualified implicit member access
expressions find declarations from unrelated classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 03:53:29 +00:00
Daniel Dunbar 7b55668db7 Add ASTUnit::LoadFromCommandLine, which creates an ASTUnit out of a list of
(clang/driver) command line arguments (including the source file).
 - The arguments are expected to include the source file.

 - The idea is that even though this is a somewhat odd API, its the form which
   many tools can most easily use (for example, by interposing with the compiler).

Also, switch index-test's -ast-from-source to use this entry point, and provide
a -arg command line argument which can be used to test that the command line
arguments are handled correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 03:23:45 +00:00
Daniel Dunbar daab7b1016 Driver: Add Command::Creator member variable, which tracks the tool that was
used to create a particular command.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 03:23:25 +00:00
Fariborz Jahanian affe67eae3 Added an assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90285 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 23:35:33 +00:00
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
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
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 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 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 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
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
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
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 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
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
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
Fariborz Jahanian 8d2c0a9814 Fix a crash when ivar type is a __strong SEL. Fallout from
recent change to make SEL a builtin type (fixes radar 7425510).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 18:43:52 +00:00
Benjamin Kramer bb377edda2 Use StringRef in Attr constructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90140 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 17:08:26 +00:00
Douglas Gregor 47491f8b7a Eliminate another VISIBILITY_HIDDEN
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90139 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 16:08:24 +00:00
Tobias Grosser 006b0eb3e1 Adapt to the DOTGraphTraits changes in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 14:16:05 +00:00
Daniel Dunbar 3b315264d1 Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:42:00 +00:00
Daniel Dunbar 39ed0b6f25 clang -cc1: Fix initialization of PreprocessorOptions::TokenCache.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:41:42 +00:00
Daniel Dunbar c238955f09 Add TextDiagnosticBuffer::FlushDiagnostics, for forwarding the buffered diagnostics to a different diagnostics engine.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:41:34 +00:00
Daniel Dunbar 43030a79db clang -cc1: Fix -include-pch now that the test code is in clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90124 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:41:22 +00:00
Daniel Dunbar 1c5944c773 clang -cc1: Initialize LangOptions::{Optimize,NoInline}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:41:13 +00:00
Daniel Dunbar a28690e5b0 Always pass -fmessage-length using separate arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:40:54 +00:00
Daniel Dunbar 2d8f3e83cc clang -cc1: Initialize LangOptions::DollarIdents correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:40:46 +00:00
Daniel Dunbar 1bc5c03a7f Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90119 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:40:34 +00:00
Daniel Dunbar b33fbaa5f1 Eliminate CodeGenOptions::TimePasses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:39:52 +00:00
Daniel Dunbar 3636e1d784 Eliminate CodeGenOptions::SimplifyLibCalls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 08:39:32 +00:00
Chris Lattner 6e2901407b Fix PR5633 by making the preprocessor handle the case where we can
stat a file but where mmaping it fails.  In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'

instead of "cannot find file".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 04:18:44 +00:00
Eli Friedman 76ed1f76f9 Minor cleanup (no functionality change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90105 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-30 01:19:33 +00:00
Daniel Dunbar 9e612408c2 clang -cc1: Use proper diagnostics for all parsing errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:52:53 +00:00
Daniel Dunbar 2da84ff228 Don't pass false (default) for isVolatile parameter to CreateLoad.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:23:36 +00:00
Daniel Dunbar 007b56738b Explicitly use setVolatile instead of extra IRBuilder argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90095 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:11:47 +00:00
Daniel Dunbar 7fda03b254 Don't pass false (default) for isVolatile parameter to CreateStore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-29 21:11:41 +00:00