]> granicus.if.org Git - clang/log
clang
15 years agoSwitch a few clients over to StringLiteral::getString.
Daniel Dunbar [Tue, 22 Sep 2009 03:27:52 +0000 (03:27 +0000)]
Switch a few clients over to StringLiteral::getString.
 - Switching all of them out-of-my-current-scope-of-interest, sorry.

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

15 years agoAdd StringLiteral::getString -> StringRef.
Daniel Dunbar [Tue, 22 Sep 2009 03:27:33 +0000 (03:27 +0000)]
Add StringLiteral::getString -> StringRef.

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

15 years agoStore the set of indirect primary bases directly in the record layout builder.
Anders Carlsson [Tue, 22 Sep 2009 03:02:06 +0000 (03:02 +0000)]
Store the set of indirect primary bases directly in the record layout builder.

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

15 years agoFix some typos. WIP. Large alignments don't work yet.
Mike Stump [Tue, 22 Sep 2009 02:44:17 +0000 (02:44 +0000)]
Fix some typos.  WIP.  Large alignments don't work yet.

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

15 years agoFix doc.
Mike Stump [Tue, 22 Sep 2009 02:43:44 +0000 (02:43 +0000)]
Fix doc.

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

15 years agoAdd test case for PR4894 (it was fixed in LLVM).
Daniel Dunbar [Tue, 22 Sep 2009 02:18:40 +0000 (02:18 +0000)]
Add test case for PR4894 (it was fixed in LLVM).

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

15 years agoThis FIXME is done.
Daniel Dunbar [Tue, 22 Sep 2009 02:17:27 +0000 (02:17 +0000)]
This FIXME is done.

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

15 years agoImprove debug info generation for __block variables.
Mike Stump [Tue, 22 Sep 2009 02:12:52 +0000 (02:12 +0000)]
Improve debug info generation for __block variables.

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

15 years agoRecord layout builder cleanup.
Anders Carlsson [Tue, 22 Sep 2009 00:04:45 +0000 (00:04 +0000)]
Record layout builder cleanup.

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

15 years agoChange all the Type::getAsFoo() methods to specializations of Type::getAs().
John McCall [Mon, 21 Sep 2009 23:43:11 +0000 (23:43 +0000)]
Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely.  Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.

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

15 years agoAdd test case for <rdar://problem/6829164>, which was implicitly fixed in r79694.
Ted Kremenek [Mon, 21 Sep 2009 23:22:11 +0000 (23:22 +0000)]
Add test case for <rdar://problem/6829164>, which was implicitly fixed in r79694.

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

15 years agoRemoved -fobjc-newgc-api option. clang now conforms to
Fariborz Jahanian [Mon, 21 Sep 2009 23:03:37 +0000 (23:03 +0000)]
Removed -fobjc-newgc-api option. clang now conforms to
gcc-style write-barrier api only.

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

15 years agoProvide intermediate solution to handling assignments to structs via an
Ted Kremenek [Mon, 21 Sep 2009 22:58:52 +0000 (22:58 +0000)]
Provide intermediate solution to handling assignments to structs via an
integer pointer.  For now just invalidate the fields of the struct.

This addresses: <rdar://problem/7185607> [RegionStore] support invalidation of bit fields using integer assignment

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

15 years agoAnother code-completion TODO
Douglas Gregor [Mon, 21 Sep 2009 20:52:01 +0000 (20:52 +0000)]
Another code-completion TODO

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

15 years agoCode completion for ordinary names when we're starting a declaration, expression...
Douglas Gregor [Mon, 21 Sep 2009 20:51:25 +0000 (20:51 +0000)]
Code completion for ordinary names when we're starting a declaration, expression, or statement

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

15 years ago-fobjc-newgc-api is now the default.
Fariborz Jahanian [Mon, 21 Sep 2009 20:17:37 +0000 (20:17 +0000)]
-fobjc-newgc-api is now the default.

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

15 years agoWhen providing a code-completion suggestion for a hidden name, include
Douglas Gregor [Mon, 21 Sep 2009 20:12:40 +0000 (20:12 +0000)]
When providing a code-completion suggestion for a hidden name, include
a nested-name-specifier that describes how to refer to that name. For
example, given:

  struct Base { int member; };
  struct Derived : Base { int member; };

the code-completion result for a member access into "Derived" will
provide both "member" to refer to Derived::member (no qualification needed) and
"Base::member" to refer to Base::member (qualification included).

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

15 years agoEnhance "case" code completion in C++ to suggest qualified names for
Douglas Gregor [Mon, 21 Sep 2009 19:57:38 +0000 (19:57 +0000)]
Enhance "case" code completion in C++ to suggest qualified names for
enumerators when either the user intentionally wrote a qualified name
(in which case we just use that nested-name-specifier to match
the user's code) or when this is the first "case" statement and we
need a qualified name to refer to an enumerator in a different scope.

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

15 years agoMiscellanous fixes in generatation of objc gc's write-barriers.
Fariborz Jahanian [Mon, 21 Sep 2009 18:54:29 +0000 (18:54 +0000)]
Miscellanous fixes in generatation of objc gc's write-barriers.

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

15 years agoCode completion for "case" statements within a switch on an expression
Douglas Gregor [Mon, 21 Sep 2009 18:10:23 +0000 (18:10 +0000)]
Code completion for "case" statements within a switch on an expression
of enumeration type, providing the various unused enumerators as options.

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

15 years agoRefactor and simplify the CodeCompleteConsumer, so that all of the
Douglas Gregor [Mon, 21 Sep 2009 16:56:56 +0000 (16:56 +0000)]
Refactor and simplify the CodeCompleteConsumer, so that all of the
real work is performed within Sema. Addresses Chris's comments, but
still retains the heavyweight list-of-multimaps data structure.

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

15 years agoAdd an XFAIL test which compiles differently from a .ast.
Daniel Dunbar [Mon, 21 Sep 2009 05:16:43 +0000 (05:16 +0000)]
Add an XFAIL test which compiles differently from a .ast.

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

15 years agoAdd missing PCH support for -fstack-protector.
Daniel Dunbar [Mon, 21 Sep 2009 04:16:19 +0000 (04:16 +0000)]
Add missing PCH support for -fstack-protector.

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

15 years agoImplement __builtin_unreachable(), a GCC 4.5 extension.
Chris Lattner [Mon, 21 Sep 2009 03:09:59 +0000 (03:09 +0000)]
Implement __builtin_unreachable(), a GCC 4.5 extension.

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

15 years agoSwitch ProcessASTInputFile to still use ParseAST.
Daniel Dunbar [Mon, 21 Sep 2009 03:03:56 +0000 (03:03 +0000)]
Switch ProcessASTInputFile to still use ParseAST.
 - Currently this requires us to fake an input file.

 - This allows Sema to be keep all the logic for how to pull decls out of the external AST source and how to handle things like tentative definitions.

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

15 years agoChange ASTUnit to only initialize the predefines buffer to the suggested predefines.
Daniel Dunbar [Mon, 21 Sep 2009 03:03:47 +0000 (03:03 +0000)]
Change ASTUnit to only initialize the predefines buffer to the suggested predefines.
 - It isn't really clear what to do with the preprocessor here, but this is more sensible.

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

15 years agoChange ASTUnit to take the Diagnostic as an argument, the client should have control...
Daniel Dunbar [Mon, 21 Sep 2009 03:03:39 +0000 (03:03 +0000)]
Change ASTUnit to take the Diagnostic as an argument, the client should have control of this.

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

15 years agoAdd Diagnostic to Indexer, and have it keep its own FileManager instead of taking...
Daniel Dunbar [Mon, 21 Sep 2009 03:03:22 +0000 (03:03 +0000)]
Add Diagnostic to Indexer, and have it keep its own FileManager instead of taking an external reference (which was leaked in the case of the CIndex library).

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

15 years agoStart mangling expressions.
Anders Carlsson [Mon, 21 Sep 2009 01:21:10 +0000 (01:21 +0000)]
Start mangling expressions.

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

15 years agoWork around FileCheck -NOT restriction.
Daniel Dunbar [Sun, 20 Sep 2009 23:35:52 +0000 (23:35 +0000)]
Work around FileCheck -NOT restriction.

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

15 years agoSwitch TestRunner.sh to just use 'lit'.
Daniel Dunbar [Sun, 20 Sep 2009 22:00:23 +0000 (22:00 +0000)]
Switch TestRunner.sh to just use 'lit'.
 - Does people use this?

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

15 years agoSwitch to using the new LLVM lit test runner by default.
Daniel Dunbar [Sun, 20 Sep 2009 22:00:17 +0000 (22:00 +0000)]
Switch to using the new LLVM lit test runner by default.

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

15 years agoInclude LLVM {src,obj} root in lit.site.cfg, to support non-standard layouts.
Daniel Dunbar [Sun, 20 Sep 2009 19:04:35 +0000 (19:04 +0000)]
Include LLVM {src,obj} root in lit.site.cfg, to support non-standard layouts.

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

15 years agoswitch command line 'parse' methods to use StringRef for efficiency, which
Chris Lattner [Sun, 20 Sep 2009 00:39:15 +0000 (00:39 +0000)]
switch command line 'parse' methods to use StringRef for efficiency, which
is also required for an llvm-side change.

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

15 years agoOk, an AssertingVH definitely doesn't work for now because we free our cache after...
Daniel Dunbar [Sat, 19 Sep 2009 20:17:48 +0000 (20:17 +0000)]
Ok, an AssertingVH definitely doesn't work for now because we free our cache after the optimizer may have hacked on the module. Use a WeakVH instead.

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

15 years agoMake clang stop relying on ConstantStruct::get's default value for isPacked
Nick Lewycky [Sat, 19 Sep 2009 20:00:52 +0000 (20:00 +0000)]
Make clang stop relying on ConstantStruct::get's default value for isPacked
which will be going away (ie. it's becoming a required parameter) later today.

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

15 years agoSwitch CGDebugInfo type cache to using an AssertingVH.
Daniel Dunbar [Sat, 19 Sep 2009 19:27:24 +0000 (19:27 +0000)]
Switch CGDebugInfo type cache to using an AssertingVH.

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

15 years agoFactor out CGDebugInfo::CreateTypeNode method.
Daniel Dunbar [Sat, 19 Sep 2009 19:27:14 +0000 (19:27 +0000)]
Factor out CGDebugInfo::CreateTypeNode method.
 - No functionality change.

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

15 years agoSimplify code with a StringRef.
Benjamin Kramer [Sat, 19 Sep 2009 08:02:46 +0000 (08:02 +0000)]
Simplify code with a StringRef.

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

15 years agoIn C++ code completion, only suggest the "template" keyword after ".",
Douglas Gregor [Fri, 18 Sep 2009 23:55:56 +0000 (23:55 +0000)]
In C++ code completion, only suggest the "template" keyword after ".",
"->", or "::" if we will be looking into a dependent context. It's not
wrong to use the "template" keyword, but it's to needed, either.

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

15 years agoMake the construction of the code-completion string for a function
Douglas Gregor [Fri, 18 Sep 2009 23:21:38 +0000 (23:21 +0000)]
Make the construction of the code-completion string for a function
template smarter, by taking into account which function template
parameters are deducible from the call arguments. For example,

  template<typename RandomAccessIterator>
  void sort(RandomAccessIterator first, RandomAccessIterator last);

will have a code-completion string like

  sort({RandomAccessIterator first}, {RandomAccessIterator last})

since the template argument for its template parameter is
deducible. On the other hand,

  template<class X, class Y>
  X* dyn_cast(Y *Val);

will have a code-completion string like

  dyn_cast<{class X}>({Y *Val})

since the template type parameter X is not deducible from the function
call.

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

15 years agoIntroduce code completion patterns for templates, which provide the
Douglas Gregor [Fri, 18 Sep 2009 22:47:56 +0000 (22:47 +0000)]
Introduce code completion patterns for templates, which provide the
angle brackets < > along with placeholder template arguments.

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

15 years agoRe-introduce diagnostic caching in BugReporter that was originally added in
Ted Kremenek [Fri, 18 Sep 2009 22:37:37 +0000 (22:37 +0000)]
Re-introduce diagnostic caching in BugReporter that was originally added in
r82198 and then reverted. This is an intermediate solution, as diagnostic
caching should not rely on static variables.

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

15 years agoReintroduce FoldingSet profiling for PathDiagnostics.
Ted Kremenek [Fri, 18 Sep 2009 22:33:39 +0000 (22:33 +0000)]
Reintroduce FoldingSet profiling for PathDiagnostics.

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

15 years agoFix regression introduced by r82198 that caused functions/methods with invalid CFGs...
Ted Kremenek [Fri, 18 Sep 2009 22:29:35 +0000 (22:29 +0000)]
Fix regression introduced by r82198 that caused functions/methods with invalid CFGs to get analyzed.

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

15 years agoIntroduce code completion strings, which describe how to *use* the
Douglas Gregor [Fri, 18 Sep 2009 22:15:54 +0000 (22:15 +0000)]
Introduce code completion strings, which describe how to *use* the
results of code completion, e.g., by providing function call syntax
with placeholders for each of the parameters.

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

15 years agoAttempt to make a test portable.
Daniel Dunbar [Fri, 18 Sep 2009 22:09:24 +0000 (22:09 +0000)]
Attempt to make a test portable.

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

15 years agoclean up xcode proj
Chris Lattner [Fri, 18 Sep 2009 20:39:54 +0000 (20:39 +0000)]
clean up xcode proj

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

15 years agoallow clearing this value.
Chris Lattner [Fri, 18 Sep 2009 20:39:46 +0000 (20:39 +0000)]
allow clearing this value.

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

15 years agoMore mangling work.
Anders Carlsson [Fri, 18 Sep 2009 20:11:09 +0000 (20:11 +0000)]
More mangling work.

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

15 years agoC++ code completion after the "operator" keyword. Provide overloaded
Douglas Gregor [Fri, 18 Sep 2009 20:05:18 +0000 (20:05 +0000)]
C++ code completion after the "operator" keyword. Provide overloaded
operators, type specifiers, type names, and nested-name-specifiers.

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

15 years agoMake the mangler conform even better to the grammar.
Anders Carlsson [Fri, 18 Sep 2009 19:44:50 +0000 (19:44 +0000)]
Make the mangler conform even better to the grammar.

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

15 years agoMake our char vector types not be explicitly signed to match GCC and to fix compilati...
Anders Carlsson [Fri, 18 Sep 2009 19:18:19 +0000 (19:18 +0000)]
Make our char vector types not be explicitly signed to match GCC and to fix compilation with C++ and -fno-lax-vector-conversions

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

15 years agoGenerate more of the vbase virtual offset for covariant thunks. WIP.
Mike Stump [Fri, 18 Sep 2009 19:06:35 +0000 (19:06 +0000)]
Generate more of the vbase virtual offset for covariant thunks.  WIP.

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

15 years agoIntroduce four new code-completion hooks for C++:
Douglas Gregor [Fri, 18 Sep 2009 19:03:04 +0000 (19:03 +0000)]
Introduce four new code-completion hooks for C++:

  - after "using", show anything that can be a nested-name-specifier.
  - after "using namespace", show any visible namespaces or namespace aliases
  - after "namespace", show any namespace definitions in the current scope
  - after "namespace identifier = ", show any visible namespaces or
    namespace aliases

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

15 years agoMore mangler mangling.
Anders Carlsson [Fri, 18 Sep 2009 19:00:18 +0000 (19:00 +0000)]
More mangler mangling.

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

15 years agoCall mangleTemplatePrefix.
Anders Carlsson [Fri, 18 Sep 2009 18:47:07 +0000 (18:47 +0000)]
Call mangleTemplatePrefix.

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

15 years agoChange manglePrefix to return early if the DC is the translation unit.
Anders Carlsson [Fri, 18 Sep 2009 18:39:58 +0000 (18:39 +0000)]
Change manglePrefix to return early if the DC is the translation unit.

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

15 years agoDon't perform name lookup into a given declaration context more than once during...
Douglas Gregor [Fri, 18 Sep 2009 18:07:23 +0000 (18:07 +0000)]
Don't perform name lookup into a given declaration context more than once during code completion

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

15 years agoHandle using declarations and overload sets in code completion.
Douglas Gregor [Fri, 18 Sep 2009 17:54:00 +0000 (17:54 +0000)]
Handle using declarations and overload sets in code completion.

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

15 years agoFor code completion in C++ member access expressions and tag names,
Douglas Gregor [Fri, 18 Sep 2009 17:42:29 +0000 (17:42 +0000)]
For code completion in C++ member access expressions and tag names,
look into the current scope for anything that could start a
nested-names-specifier. These results are ranked worse than any of the
results actually found in the lexical scope.

Perform a little more pruning of the result set, eliminating
constructors, __va_list_tag, and any duplication of declarations in
the result set. For the latter, implemented
NamespaceDecl::getCanonicalDecl.

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

15 years agoFix PR4923.
Anders Carlsson [Fri, 18 Sep 2009 17:03:55 +0000 (17:03 +0000)]
Fix PR4923.

Fix error in _mm_set_pd/_mm_setr_pd and add _mm_set_epi64x/_mm_set1_epi64x. Patch by Laurent Morichetti!

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

15 years agoWhen gathering results for code completion, only include hidden
Douglas Gregor [Fri, 18 Sep 2009 15:51:54 +0000 (15:51 +0000)]
When gathering results for code completion, only include hidden
results when there is some way to refer to them in the language, such
as with a qualified name in C++.

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

15 years agoImplement code completion for tags, e.g., code completion after "enum"
Douglas Gregor [Fri, 18 Sep 2009 15:37:17 +0000 (15:37 +0000)]
Implement code completion for tags, e.g., code completion after "enum"
will provide the names of various enumerations currently
visible. Introduced filtering of code-completion results when we build
the result set, so that we can identify just the kinds of declarations
we want.

This implementation is incomplete for C++, since we don't consider
that the token after the tag keyword could start a
nested-name-specifier.

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

15 years agoMake the GCC warning flags passed by CMake the same as the warning flags passed in...
Douglas Gregor [Fri, 18 Sep 2009 14:47:57 +0000 (14:47 +0000)]
Make the GCC warning flags passed by CMake the same as the warning flags passed in the make build

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

15 years agoDisable questionable code for handling isNullPointerConstant on value dependent
Daniel Dunbar [Fri, 18 Sep 2009 08:46:16 +0000 (08:46 +0000)]
Disable questionable code for handling isNullPointerConstant on value dependent
expression.

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

15 years agoForce a triple.
Daniel Dunbar [Fri, 18 Sep 2009 08:46:07 +0000 (08:46 +0000)]
Force a triple.

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

15 years agoSplit Darwin toolchain into Clang and GCC Darwin toolchains with a common base.
Daniel Dunbar [Fri, 18 Sep 2009 08:15:13 +0000 (08:15 +0000)]
Split Darwin toolchain into Clang and GCC Darwin toolchains with a common base.

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

15 years agoLift AddLinkRuntimeLibArgs into Darwin tool chain.
Daniel Dunbar [Fri, 18 Sep 2009 08:15:03 +0000 (08:15 +0000)]
Lift AddLinkRuntimeLibArgs into Darwin tool chain.

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

15 years agoMove isMacosxVersionLT helpers to Darwin tool chain.
Daniel Dunbar [Fri, 18 Sep 2009 08:14:55 +0000 (08:14 +0000)]
Move isMacosxVersionLT helpers to Darwin tool chain.

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

15 years agoLift getMacosxVersionMin out into Darwin ToolChain.
Daniel Dunbar [Fri, 18 Sep 2009 08:14:46 +0000 (08:14 +0000)]
Lift getMacosxVersionMin out into Darwin ToolChain.

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

15 years agoLift AddLinkerSearchPaths() into Darwin tool chain.
Daniel Dunbar [Fri, 18 Sep 2009 08:14:36 +0000 (08:14 +0000)]
Lift AddLinkerSearchPaths() into Darwin tool chain.

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

15 years agoRename a variable to match its semantics.
Daniel Dunbar [Fri, 18 Sep 2009 08:14:24 +0000 (08:14 +0000)]
Rename a variable to match its semantics.

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

15 years agoRevert most of r82198, which was causing a large number of crashes
Ted Kremenek [Fri, 18 Sep 2009 07:31:15 +0000 (07:31 +0000)]
Revert most of r82198, which was causing a large number of crashes
when running the analyzer on real projects.  We'll keep the change to
AnalysisManager.cpp in r82198 so that -fobjc-gc analyzes code
correctly in both GC and non-GC modes, although this may emit two
diagnostics for each bug in some cases (a better solution will come
later).

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

15 years agoIntroduce caching of diagnostics in BugReporter. This provides extra
Ted Kremenek [Fri, 18 Sep 2009 05:37:41 +0000 (05:37 +0000)]
Introduce caching of diagnostics in BugReporter.  This provides extra
pruning of diagnostics that may be emitted multiple times.  This is
accomplished by adding FoldingSet profiling support to PathDiagnostic,
and then having BugReporter record what diagnostics have been issued.

This was motived to a serious bug introduced by moving the
'divide-by-zero' checking outside of GRExprEngine into a separate
'Checker' class.  When analyzing code using the '-fobjc-gc' option, a
given function would be analyzed twice, but the second time various
"internal checks" would be disabled to avoid emitting multiple
diagnostics (e.g., "null dereference") for the same issue.  The
problem is that such checks also effect path pruning and don't just
emit diagnostics.  This resulted in an assertion failure involving a
real divide-by-zero in some analyzed code where we would get an
assertion failure in APInt because the 'DivZero' check was disabled
and didn't prune the logic that resulted in the divide-by-zero in the
analyzer.

The implemented solution is somewhat of a hack, and may not perform
extremely well.  This will need to be cleaned up over time.

As a regression test, 'misc-ps.m' has been modified so that its tests
are run using -fobjc-gc to test this diagnostic pruning behavior.

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

15 years agodon't stick an uninitialized 'stat' buf into the stat cache, fill it
Chris Lattner [Fri, 18 Sep 2009 04:51:01 +0000 (04:51 +0000)]
don't stick an uninitialized 'stat' buf into the stat cache, fill it
with zeros.  This avoids a GCC warning (PR5000)

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

15 years agoMore mangling goodness.
Anders Carlsson [Fri, 18 Sep 2009 04:29:09 +0000 (04:29 +0000)]
More mangling goodness.

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

15 years agoFix error in test.
Anders Carlsson [Fri, 18 Sep 2009 02:51:58 +0000 (02:51 +0000)]
Fix error in test.

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

15 years agoHandle mangling of TemplateSpecializationType.
Anders Carlsson [Fri, 18 Sep 2009 02:42:01 +0000 (02:42 +0000)]
Handle mangling of TemplateSpecializationType.

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

15 years agoFixed a bug in generation of the new write-barriers when
Fariborz Jahanian [Fri, 18 Sep 2009 00:04:00 +0000 (00:04 +0000)]
Fixed a bug in generation of the new write-barriers when
array syntax is used to derefernce and assign to ivar pointee.

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

15 years agoFix typo.
Mike Stump [Thu, 17 Sep 2009 21:46:24 +0000 (21:46 +0000)]
Fix typo.

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

15 years agoInitial implementation of a code-completion interface in Clang. In
Douglas Gregor [Thu, 17 Sep 2009 21:32:03 +0000 (21:32 +0000)]
Initial implementation of a code-completion interface in Clang. In
essence, code completion is triggered by a magic "code completion"
token produced by the lexer [*], which the parser recognizes at
certain points in the grammar. The parser then calls into the Action
object with the appropriate CodeCompletionXXX action.

Sema implements the CodeCompletionXXX callbacks by performing minimal
translation, then forwarding them to a CodeCompletionConsumer
subclass, which uses the results of semantic analysis to provide
code-completion results. At present, only a single, "printing" code
completion consumer is available, for regression testing and
debugging. However, the design is meant to permit other
code-completion consumers.

This initial commit contains two code-completion actions: one for
member access, e.g., "x." or "p->", and one for
nested-name-specifiers, e.g., "std::". More code-completion actions
will follow, along with improved gathering of code-completion results
for the various contexts.

[*] In the current -code-completion-dump testing/debugging mode, the
file is truncated at the completion point and EOF is translated into
"code completion".

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

15 years agoFix typo.
Mike Stump [Thu, 17 Sep 2009 21:15:00 +0000 (21:15 +0000)]
Fix typo.

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

15 years agoTweak clang testing.
Daniel Dunbar [Thu, 17 Sep 2009 19:55:53 +0000 (19:55 +0000)]
Tweak clang testing.
 - Move CMake to using the new test runner.

 - Switch Makefiles to use the lit.site.cfg.in template.

 - Remove explicit --path arguments, instead this gets written into the site
   configuration. This means running lit from the command line should use the
   exact same configuration as is used in 'make test', assuming it can find the
   site configuration file. You still need to run 'make test' (or the cmake
   build target equivalent) at least once.

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

15 years agoMerge uninstantiated default arguments more carefully, and try not to
Douglas Gregor [Thu, 17 Sep 2009 19:51:30 +0000 (19:51 +0000)]
Merge uninstantiated default arguments more carefully, and try not to
complain about specializations of member functions that are not
definitions. Fixes PR4995.

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

15 years agoAdd clang_disposeTranslationUnit() and clang_disposeIndex().
Steve Naroff [Thu, 17 Sep 2009 18:33:27 +0000 (18:33 +0000)]
Add clang_disposeTranslationUnit() and clang_disposeIndex().

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

15 years agoARM: Incremental improvement to preprocessor defines.
Daniel Dunbar [Thu, 17 Sep 2009 16:21:10 +0000 (16:21 +0000)]
ARM: Incremental improvement to preprocessor defines.
 - Based on patch by Shantonu.

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

15 years agoIgnore extern "C++" { } when mangling.
Anders Carlsson [Thu, 17 Sep 2009 16:12:20 +0000 (16:12 +0000)]
Ignore extern "C++" { } when mangling.

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

15 years agoForce triple for tests using __strong.
Daniel Dunbar [Thu, 17 Sep 2009 07:21:40 +0000 (07:21 +0000)]
Force triple for tests using __strong.

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

15 years agoAdd ARM register names and aliases.
Daniel Dunbar [Thu, 17 Sep 2009 07:03:19 +0000 (07:03 +0000)]
Add ARM register names and aliases.
 - Patch by Shantonu Sen!

<rdar://problem/6922650> clang doesn't know about ARM registers for inline asm clobber lists

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

15 years agoDriver: Change -O to mean -O2, -O1 is meaningless.
Daniel Dunbar [Thu, 17 Sep 2009 06:53:36 +0000 (06:53 +0000)]
Driver: Change -O to mean -O2, -O1 is meaningless.

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

15 years agoFix two crashes on value dependent expressions (shift and null-pointer check).
Daniel Dunbar [Thu, 17 Sep 2009 06:31:27 +0000 (06:31 +0000)]
Fix two crashes on value dependent expressions (shift and null-pointer check).
 - Doug, please check.

 - PR4940.

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

15 years agoRemove trailing whitespace.
Daniel Dunbar [Thu, 17 Sep 2009 06:31:17 +0000 (06:31 +0000)]
Remove trailing whitespace.

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

15 years agoAdd a bunch of math builtins, #include <cmath> passes now.
Daniel Dunbar [Thu, 17 Sep 2009 05:45:52 +0000 (05:45 +0000)]
Add a bunch of math builtins, #include <cmath> passes now.

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

15 years agoRevert r82123 for now.
Anders Carlsson [Thu, 17 Sep 2009 05:31:47 +0000 (05:31 +0000)]
Revert r82123 for now.

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

15 years agoTemporary band-aid for handling empty classes somewhat better.
Anders Carlsson [Thu, 17 Sep 2009 04:42:56 +0000 (04:42 +0000)]
Temporary band-aid for handling empty classes somewhat better.

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

15 years agoTreat an unqualified RecordType as a RecordDecl when substituting.
Anders Carlsson [Thu, 17 Sep 2009 04:38:23 +0000 (04:38 +0000)]
Treat an unqualified RecordType as a RecordDecl when substituting.

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

15 years agoSubstitution for prefixes.
Anders Carlsson [Thu, 17 Sep 2009 04:16:28 +0000 (04:16 +0000)]
Substitution for prefixes.

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

15 years agoConvert mangle-subst.cpp over to using FileCheck.
Anders Carlsson [Thu, 17 Sep 2009 04:13:54 +0000 (04:13 +0000)]
Convert mangle-subst.cpp over to using FileCheck.

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

15 years agoImprove driver error message when only running the preprocessor and an input is
Daniel Dunbar [Thu, 17 Sep 2009 04:13:26 +0000 (04:13 +0000)]
Improve driver error message when only running the preprocessor and an input is
already preprocessed.

--
ddunbar@giles:tmp$ touch t.i
ddunbar@giles:tmp$ gcc -E t.i
ddunbar@giles:tmp$ clang -E t.i
clang: warning: t.i: previously preprocessed input unused when '-E' is present
ddunbar@giles:tmp$
--

<rdar://problem/6813375> [driver] driver prints confusing message when running -E on preprocessed file

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