]> granicus.if.org Git - clang/log
clang
14 years agoAdd clang -cc1 support for -remap-file.
Daniel Dunbar [Thu, 3 Dec 2009 05:11:16 +0000 (05:11 +0000)]
Add clang -cc1 support for -remap-file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90414 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd clang -cc1 -load option.
Daniel Dunbar [Thu, 3 Dec 2009 05:11:05 +0000 (05:11 +0000)]
Add clang -cc1 -load option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90413 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix thunk generation for thunks with a parameter with reference type.
Eli Friedman [Thu, 3 Dec 2009 04:49:52 +0000 (04:49 +0000)]
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

14 years agoMinor cleanup.
Eli Friedman [Thu, 3 Dec 2009 04:27:05 +0000 (04:27 +0000)]
Minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90411 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoHonor using declarations in overload resolution. Most of the code for
John McCall [Thu, 3 Dec 2009 04:06:58 +0000 (04:06 +0000)]
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

14 years agoAdd support for thunking dtors. Oh why does this make my head hurt?
Mike Stump [Thu, 3 Dec 2009 03:47:56 +0000 (03:47 +0000)]
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

14 years agoReflow.
Mike Stump [Thu, 3 Dec 2009 03:40:14 +0000 (03:40 +0000)]
Reflow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90407 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r90402 for now, virt.cpp is failing.
Anders Carlsson [Thu, 3 Dec 2009 03:28:24 +0000 (03:28 +0000)]
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

14 years agoAdd batch version of 'StoreManager::InvalidateRegion()' for invalidating multiple...
Ted Kremenek [Thu, 3 Dec 2009 03:27:11 +0000 (03:27 +0000)]
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

14 years agoUse Eli's ComputeThunkAdjustment for calculating the return adjustment.
Anders Carlsson [Thu, 3 Dec 2009 03:15:31 +0000 (03:15 +0000)]
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

14 years agoAdd CodeGenModule::ComputeThunkAdjustment, which Eli wrote.
Anders Carlsson [Thu, 3 Dec 2009 03:06:55 +0000 (03:06 +0000)]
Add CodeGenModule::ComputeThunkAdjustment, which Eli wrote.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90401 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the index from the Thunk struct.
Anders Carlsson [Thu, 3 Dec 2009 02:41:55 +0000 (02:41 +0000)]
Remove the index from the Thunk struct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90400 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the Thunks map to use the vtable index as the key.
Anders Carlsson [Thu, 3 Dec 2009 02:39:59 +0000 (02:39 +0000)]
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

14 years agoAdd the global decl to the Thunk struct.
Anders Carlsson [Thu, 3 Dec 2009 02:36:40 +0000 (02:36 +0000)]
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

14 years agoRemove unused struct fields.
Anders Carlsson [Thu, 3 Dec 2009 02:34:59 +0000 (02:34 +0000)]
Remove unused struct fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90397 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDelay computing the return adjustments for covariant thunks until when they are added...
Anders Carlsson [Thu, 3 Dec 2009 02:32:59 +0000 (02:32 +0000)]
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

14 years agoNo need to create the covariant thunk in both places now.
Anders Carlsson [Thu, 3 Dec 2009 02:22:59 +0000 (02:22 +0000)]
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

14 years agoWhoops, forgot to save :)
Anders Carlsson [Thu, 3 Dec 2009 02:20:26 +0000 (02:20 +0000)]
Whoops, forgot to save :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90393 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove the index field from the CovariantThunk structure.
Anders Carlsson [Thu, 3 Dec 2009 02:16:14 +0000 (02:16 +0000)]
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

14 years agoChange the CovariantThunk map to use the vtable index as its key.
Anders Carlsson [Thu, 3 Dec 2009 02:12:03 +0000 (02:12 +0000)]
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

14 years agoFix typo.
Ted Kremenek [Thu, 3 Dec 2009 02:06:43 +0000 (02:06 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90390 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd __has_feature(cxx_exceptions) and __has_feature(cxx_rtti) to table of contents.
Ted Kremenek [Thu, 3 Dec 2009 02:05:57 +0000 (02:05 +0000)]
Add __has_feature(cxx_exceptions) and __has_feature(cxx_rtti) to table of contents.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90389 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd section on what language features __has_feature() supports for querying if they...
Ted Kremenek [Thu, 3 Dec 2009 02:04:01 +0000 (02:04 +0000)]
Add section on what language features __has_feature() supports for querying if they are enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90388 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStore a GlobalDecl in the return adjustment.
Anders Carlsson [Thu, 3 Dec 2009 02:03:29 +0000 (02:03 +0000)]
Store a GlobalDecl in the return adjustment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90387 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not include the 'this' pointer adjustment in the covariant return type. Instead...
Anders Carlsson [Thu, 3 Dec 2009 01:58:20 +0000 (01:58 +0000)]
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

14 years agoSwitch clang_createTranslationUnitFromSourceFile to use ASTUnit::LoadFromCommandLine.
Daniel Dunbar [Thu, 3 Dec 2009 01:54:28 +0000 (01:54 +0000)]
Switch clang_createTranslationUnitFromSourceFile to use ASTUnit::LoadFromCommandLine.
 - This is much faster, as it avoids the overhead of dumping an AST file to disk and reloading it.
 - For debugging purposes, there is a clang_setUseExternalASTGeneration hook which can be used to disable this.

On the Sketch Cocoa app, the speedup is pretty nice, especially when using a PCH file while scanning the source:

Wall time to c-index-test all files (no PCH):
Old: 23.4221
New: 12.3884

Wall time to c-index-test all files (with a PCH, and "local" mode):
Old: 10.9233
New:  1.9038

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90385 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove VtableBuilder::OverrideMethod out of line in preparation of other changes to...
Anders Carlsson [Thu, 3 Dec 2009 01:54:02 +0000 (01:54 +0000)]
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

14 years agoFix ASTUnit to allows require a (persistent) Diagnostic object be provided; propogate...
Daniel Dunbar [Thu, 3 Dec 2009 01:45:44 +0000 (01:45 +0000)]
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

14 years agoAdd 'has_feature(cxx_exceptions)' to allow code to determine via preprocessor logic...
Ted Kremenek [Thu, 3 Dec 2009 01:34:15 +0000 (01:34 +0000)]
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

14 years agoRemove untrue statement.
Mike Stump [Thu, 3 Dec 2009 01:34:13 +0000 (01:34 +0000)]
Remove untrue statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90377 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename has_feature(rtti) to has_feature(cxx_rtti) for clarity.
Ted Kremenek [Thu, 3 Dec 2009 01:31:28 +0000 (01:31 +0000)]
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

14 years agoNote a failure I saw from the g++ testsuite:
Mike Stump [Thu, 3 Dec 2009 01:22:05 +0000 (01:22 +0000)]
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

14 years agoAdd FileCheck test for '__has_feature(rtti)'.
Ted Kremenek [Thu, 3 Dec 2009 01:17:43 +0000 (01:17 +0000)]
Add FileCheck test for '__has_feature(rtti)'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90373 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd "has_feature" support for C++ RTTI.
Ted Kremenek [Thu, 3 Dec 2009 01:02:35 +0000 (01:02 +0000)]
Add "has_feature" support for C++ RTTI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90368 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoStop stripping UnresolvedUsingDecls out of LookupResults that have other
John McCall [Thu, 3 Dec 2009 00:58:24 +0000 (00:58 +0000)]
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

14 years agoAdd a heuristic to the dead stores checker to prune dead stores for variables annotat...
Ted Kremenek [Thu, 3 Dec 2009 00:46:16 +0000 (00:46 +0000)]
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

14 years agoIntroduce the notion of literal types, as specified in C++0x.
Sebastian Redl [Thu, 3 Dec 2009 00:13:20 +0000 (00:13 +0000)]
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

14 years agoWork-in-progress: teach mangler how to mangle thunks for destructors.
Eli Friedman [Thu, 3 Dec 2009 00:03:05 +0000 (00:03 +0000)]
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

14 years agoUpdate example link lines.
Daniel Dunbar [Thu, 3 Dec 2009 00:00:22 +0000 (00:00 +0000)]
Update example link lines.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90359 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoCleanups on exceptional edges don't work at all, yet. This doesn't
Mike Stump [Wed, 2 Dec 2009 23:46:02 +0000 (23:46 +0000)]
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

14 years agoAdd a cleanup scope for each catch clause.
Mike Stump [Wed, 2 Dec 2009 23:37:16 +0000 (23:37 +0000)]
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

14 years agoAdd missing branch to exit. Seemingly obvious when I look at the
Mike Stump [Wed, 2 Dec 2009 23:28:08 +0000 (23:28 +0000)]
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

14 years agoImprove source location information for C++ member initializers in a
Douglas Gregor [Wed, 2 Dec 2009 22:36:29 +0000 (22:36 +0000)]
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

14 years agoNormalize CIndex/c-index-test/index-test link lines in the hopes it will fix
Daniel Dunbar [Wed, 2 Dec 2009 21:47:55 +0000 (21:47 +0000)]
Normalize CIndex/c-index-test/index-test link lines in the hopes it will fix
*something*.
 - We really need to fix how LLVM's build systems manage
   linking. Pretty-please-someone-else-do-this? :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90350 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoASTUnit: Explicitly track whether the ASTUnit came from an actual AST or not.
Daniel Dunbar [Wed, 2 Dec 2009 21:47:43 +0000 (21:47 +0000)]
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

14 years agoASTUnit: Fix initialization of OnlyLocalDecls variable, and honor UseBumpAllocator.
Daniel Dunbar [Wed, 2 Dec 2009 21:47:32 +0000 (21:47 +0000)]
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

14 years agoFix for PR5522 and PR5666: fix a bunch of mangling issues with extern variables
Eli Friedman [Wed, 2 Dec 2009 20:32:49 +0000 (20:32 +0000)]
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

14 years agoUse a more rigorous definition of 'class member'. I don't have any evidence
John McCall [Wed, 2 Dec 2009 20:26:00 +0000 (20:26 +0000)]
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

14 years agothis also depends on libDriver. this almost fixes the build problems of c-index-test
Nuno Lopes [Wed, 2 Dec 2009 20:20:47 +0000 (20:20 +0000)]
this also depends on libDriver. this almost fixes the build problems of c-index-test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90342 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRecognize that EnumConstantDecls can be found by lookup and are not instance
John McCall [Wed, 2 Dec 2009 19:59:55 +0000 (19:59 +0000)]
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

14 years agoPull the terminate handler up so that we can use it for the catch
Mike Stump [Wed, 2 Dec 2009 19:53:57 +0000 (19:53 +0000)]
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

14 years agoTurn off for now.
Mike Stump [Wed, 2 Dec 2009 19:50:41 +0000 (19:50 +0000)]
Turn off for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90339 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPut the Builder classes into the anonymous namespace.
Mike Stump [Wed, 2 Dec 2009 19:07:44 +0000 (19:07 +0000)]
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

14 years agoChange rtti/Rtti to RTTI, as it is an acronym.
Mike Stump [Wed, 2 Dec 2009 18:57:08 +0000 (18:57 +0000)]
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

14 years agoRename CGRtti.cpp to CGRTTI.cpp.
Mike Stump [Wed, 2 Dec 2009 18:32:08 +0000 (18:32 +0000)]
Rename CGRtti.cpp to CGRTTI.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90331 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid warning for getTerminateFn defined but not used.
Mike Stump [Wed, 2 Dec 2009 18:20:18 +0000 (18:20 +0000)]
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

14 years agoExtend -remap-file=from;to to permit mapping from a non-existent
Douglas Gregor [Wed, 2 Dec 2009 18:12:28 +0000 (18:12 +0000)]
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

14 years agoIn Sema, whenever we think that a function is going to cause a vtable to be generated...
Anders Carlsson [Wed, 2 Dec 2009 17:15:43 +0000 (17:15 +0000)]
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

14 years agoUpdate checker build.
Ted Kremenek [Wed, 2 Dec 2009 16:42:21 +0000 (16:42 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90323 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMove file-remapping logic into InitPreprocesor. No functionality change
Douglas Gregor [Wed, 2 Dec 2009 16:32:41 +0000 (16:32 +0000)]
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

14 years agoExtend the CIndex code-completion API to perform code completion
Douglas Gregor [Wed, 2 Dec 2009 09:21:34 +0000 (09:21 +0000)]
Extend the CIndex code-completion API to perform code completion
involving unsaved files, using the -remap-file= functionality recently
added to clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90314 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agor90313, in which OverloadedFunctionDecl is removed and never spoken of again.
John McCall [Wed, 2 Dec 2009 08:47:38 +0000 (08:47 +0000)]
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

14 years agoFix relative ordering of Analyis library.
Daniel Dunbar [Wed, 2 Dec 2009 08:44:24 +0000 (08:44 +0000)]
Fix relative ordering of Analyis library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90312 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix ASTUnit::getOriginalSourceFileName() when using ASTUnit's derived from
Daniel Dunbar [Wed, 2 Dec 2009 08:44:16 +0000 (08:44 +0000)]
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

14 years agoASTUnit: Don't create an LLVMContext, it shouldn't be needed.
Daniel Dunbar [Wed, 2 Dec 2009 08:43:56 +0000 (08:43 +0000)]
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

14 years agoRip out the last remaining implicit use of OverloadedFunctionDecl in Sema:
John McCall [Wed, 2 Dec 2009 08:25:40 +0000 (08:25 +0000)]
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

14 years agoterminate doesn't throw.
Mike Stump [Wed, 2 Dec 2009 08:18:09 +0000 (08:18 +0000)]
terminate doesn't throw.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90308 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoIntroduce a new clang-cc option
Douglas Gregor [Wed, 2 Dec 2009 08:08:39 +0000 (08:08 +0000)]
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

14 years agoPush overloaded function templates through the parser using a totally different
John McCall [Wed, 2 Dec 2009 08:04:21 +0000 (08:04 +0000)]
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

14 years agoMore exception handling improvements... WIP.
Mike Stump [Wed, 2 Dec 2009 07:41:41 +0000 (07:41 +0000)]
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

14 years agoFix another "operator delete missing" crash: make sure we don't check
Eli Friedman [Wed, 2 Dec 2009 07:16:50 +0000 (07:16 +0000)]
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

14 years agoTweak test to check for a bit more.
Eli Friedman [Wed, 2 Dec 2009 07:04:32 +0000 (07:04 +0000)]
Tweak test to check for a bit more.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90302 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoMake sure to call AddOverriddenMethods for implicit copy assignment operators;
Eli Friedman [Wed, 2 Dec 2009 06:59:20 +0000 (06:59 +0000)]
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

14 years agoExtend the source manager with the ability to override the contents of
Douglas Gregor [Wed, 2 Dec 2009 06:49:09 +0000 (06:49 +0000)]
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

14 years agoHard bifurcate the state into nil receiver and non-nil receiver, so that
Zhongxing Xu [Wed, 2 Dec 2009 05:49:12 +0000 (05:49 +0000)]
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

14 years agolibFrontend depends on libDriver now.
Zhongxing Xu [Wed, 2 Dec 2009 05:45:19 +0000 (05:45 +0000)]
libFrontend depends on libDriver now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90295 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEliminate the unnecessary FirstFID cache variable from the source manager's ContentCache
Douglas Gregor [Wed, 2 Dec 2009 05:34:39 +0000 (05:34 +0000)]
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

14 years agoStop trying to analyze class-hierarchies for dependently-scoped id-expressions;
John McCall [Wed, 2 Dec 2009 03:53:29 +0000 (03:53 +0000)]
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

14 years agoAdd ASTUnit::LoadFromCommandLine, which creates an ASTUnit out of a list of
Daniel Dunbar [Wed, 2 Dec 2009 03:23:45 +0000 (03:23 +0000)]
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

14 years agoDriver: Add Command::Creator member variable, which tracks the tool that was
Daniel Dunbar [Wed, 2 Dec 2009 03:23:25 +0000 (03:23 +0000)]
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

14 years agoAdded an assert.
Fariborz Jahanian [Tue, 1 Dec 2009 23:35:33 +0000 (23:35 +0000)]
Added an assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90285 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix a code gen. crash synthesizing a destructor.
Fariborz Jahanian [Tue, 1 Dec 2009 23:18:25 +0000 (23:18 +0000)]
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

14 years agoIn SourceManager::isBeforeInTranslationUnit, if we are trying to compare two source...
Daniel Dunbar [Tue, 1 Dec 2009 23:07:57 +0000 (23:07 +0000)]
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

14 years agoAdded dead-stores test cases that involve the use of blocks.
Ted Kremenek [Tue, 1 Dec 2009 23:04:14 +0000 (23:04 +0000)]
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

14 years agopass the reason for failure up from MemoryBuffer and report it
Chris Lattner [Tue, 1 Dec 2009 22:52:33 +0000 (22:52 +0000)]
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

14 years agoAdd new test case file that focuses on testing analyzer support for blocks.
Ted Kremenek [Tue, 1 Dec 2009 22:47:46 +0000 (22:47 +0000)]
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

14 years agoMake EmitStoreOfScalar generate a more sane representation of boolean stores.
Eli Friedman [Tue, 1 Dec 2009 22:31:51 +0000 (22:31 +0000)]
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

14 years agoFix IsProvablyNotDerivedFrom to always use record definitions when available.
John McCall [Tue, 1 Dec 2009 22:28:41 +0000 (22:28 +0000)]
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

14 years agoThe minimum element size in BumpVector should be 1, not 0.
Ted Kremenek [Tue, 1 Dec 2009 22:13:00 +0000 (22:13 +0000)]
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

14 years agoProvide the correct vector size for referenced variables.
Ted Kremenek [Tue, 1 Dec 2009 22:12:34 +0000 (22:12 +0000)]
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

14 years agoRework how we support C++ implicit member accesses. If we can resolve an
John McCall [Tue, 1 Dec 2009 22:10:20 +0000 (22:10 +0000)]
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

14 years agoAdd test case for PR5662.
Daniel Dunbar [Tue, 1 Dec 2009 21:57:39 +0000 (21:57 +0000)]
Add test case for PR5662.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90264 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoASTUnit: Make sure to preserve the TargetInfo for later use.
Daniel Dunbar [Tue, 1 Dec 2009 21:57:33 +0000 (21:57 +0000)]
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

14 years agoFix typo.
Daniel Dunbar [Tue, 1 Dec 2009 21:57:27 +0000 (21:57 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90262 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd {ExternalSemaSource,SemaConsumer}::ForgetSema callback, and update PCHReader
Daniel Dunbar [Tue, 1 Dec 2009 21:57:20 +0000 (21:57 +0000)]
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

14 years agoExit the command line into <built-in> instead of going directly from the command...
Rafael Espindola [Tue, 1 Dec 2009 18:28:16 +0000 (18:28 +0000)]
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

14 years ago(objc2 nonfragile-abi specific). If the translation unit includes an implementation
Fariborz Jahanian [Tue, 1 Dec 2009 18:25:24 +0000 (18:25 +0000)]
(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

14 years agoFix early-return logic in scanReachableSymbols() to match the rest of the recursive...
Ted Kremenek [Tue, 1 Dec 2009 17:50:25 +0000 (17:50 +0000)]
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

14 years agoConvert Diagnostic::getCustomDiagID to take a StringRef.
Daniel Dunbar [Tue, 1 Dec 2009 17:42:06 +0000 (17:42 +0000)]
Convert Diagnostic::getCustomDiagID to take a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90244 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFuntion templates and function template specializations do not
Douglas Gregor [Tue, 1 Dec 2009 17:35:23 +0000 (17:35 +0000)]
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