]> granicus.if.org Git - clang/log
clang
15 years agoCIndex: replace fork/exec with our portable ExecuteAndWait wrapper.
Benjamin Kramer [Sun, 18 Oct 2009 11:19:36 +0000 (11:19 +0000)]
CIndex: replace fork/exec with our portable ExecuteAndWait wrapper.

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

15 years agoCIndex: avoid a dangling pointer issue.
Benjamin Kramer [Sun, 18 Oct 2009 11:10:55 +0000 (11:10 +0000)]
CIndex: avoid a dangling pointer issue.

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

15 years agoWhen performing template-substitution into a type, don't just replace the
John McCall [Sun, 18 Oct 2009 09:09:24 +0000 (09:09 +0000)]
When performing template-substitution into a type, don't just replace the
TemplateTypeParmType with the substituted type directly;  instead, replace it
with a SubstTemplateTypeParmType which will note that the type was originally
written as a template type parameter.  This makes it reasonable to preserve
source information even through template substitution.

Also define the new SubstTemplateTypeParmType class, obviously.

For consistency with current behavior, we stringize these types as if they
were the underlying type.  I'm not sure this is the right thing to do.
At any rate, I paled at adding yet another clause to the don't-desugar 'if'
statement, so I extracted a function to do it.  The new function also does
The Right Thing more often, I think:  e.g. if we have a chain of typedefs
leading to a vector type, we will now desugar all but the last one.

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

15 years agouse DenseSet instead of SmallSet.
Zhongxing Xu [Sun, 18 Oct 2009 04:15:47 +0000 (04:15 +0000)]
use DenseSet instead of SmallSet.

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

15 years agoAdd NameDecl::getName() -> StringRef.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:45 +0000 (02:09 +0000)]
Add NameDecl::getName() -> StringRef.

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

15 years agoAdd another two ExtVectorComponent FIXMEs.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:38 +0000 (02:09 +0000)]
Add another two ExtVectorComponent FIXMEs.

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

15 years agoSwitch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:31 +0000 (02:09 +0000)]
Switch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
 - Really this should be simplified by the FIXME above, but I'm too deep in DFS.

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

15 years agoSimplify HandleModeAttr.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:24 +0000 (02:09 +0000)]
Simplify HandleModeAttr.

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

15 years agoSimplify HandleFormatAttr.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:17 +0000 (02:09 +0000)]
Simplify HandleFormatAttr.
 - I have this crazy dream that one day someone will invent a miraculous tool so
   that developers, instead of hand optimizing their source code to obscure its
   intent and decrease its maleability, will instead write what they mean, and
   this strange and wonderful tool -- which I imagine would be called something
   fancy sounding like "an optimizing compiler" -- will make their code fast
   *for* them. With all the saved time, developers could maybe even focus on
   making the magic "optimizing compiler" better!!

 - No intended functionality change, all though I expect the universe to mock me
   for snarkiness.

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

15 years agoAdd FIXME... maybe Nate will get bored? :)
Daniel Dunbar [Sun, 18 Oct 2009 02:09:09 +0000 (02:09 +0000)]
Add FIXME... maybe Nate will get bored? :)

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

15 years agoGrammaro.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:02 +0000 (02:09 +0000)]
Grammaro.

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

15 years agoClone the full Type hierarchy into the TypeLoc hierarchy. Normalize
John McCall [Sun, 18 Oct 2009 01:05:36 +0000 (01:05 +0000)]
Clone the full Type hierarchy into the TypeLoc hierarchy.  Normalize
TypeLoc class names to be $(Type classname)Loc.  Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.

Handle all cases in PCH.  Handle a few more cases when inserting
location information in SemaType.

It should be extremely straightforward to add new location information
to existing TypeLoc objects now.

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

15 years agoAttempt to unbreak the MSVC build.
Daniel Dunbar [Sat, 17 Oct 2009 23:53:11 +0000 (23:53 +0000)]
Attempt to unbreak the MSVC build.

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

15 years agoSimplify ExtVectorElementExpr::containsDuplicateElements().
Daniel Dunbar [Sat, 17 Oct 2009 23:53:04 +0000 (23:53 +0000)]
Simplify ExtVectorElementExpr::containsDuplicateElements().

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

15 years agoAdd FIXME.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:58 +0000 (23:52 +0000)]
Add FIXME.

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

15 years agoAvoid std::string concatenation.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:50 +0000 (23:52 +0000)]
Avoid std::string concatenation.

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

15 years agoStringRefize some parts of Diagnostic API.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:43 +0000 (23:52 +0000)]
StringRefize some parts of Diagnostic API.

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

15 years agoRemove unused BernsteinHash functions.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:36 +0000 (23:52 +0000)]
Remove unused BernsteinHash functions.

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

15 years agoSwitch to llvm::HashString.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:28 +0000 (23:52 +0000)]
Switch to llvm::HashString.

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

15 years agoadd gentoo x86 2009.1 (gcc 4.3.4) include paths
Nuno Lopes [Sat, 17 Oct 2009 23:11:14 +0000 (23:11 +0000)]
add gentoo x86 2009.1 (gcc 4.3.4) include paths

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

15 years agoFix a crash with qualified member access into a non-type, from Sean Hunt!
Douglas Gregor [Sat, 17 Oct 2009 22:37:54 +0000 (22:37 +0000)]
Fix a crash with qualified member access into a non-type, from Sean Hunt!

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

15 years agoDescribe/link some of the universal driver related work.
Daniel Dunbar [Sat, 17 Oct 2009 22:08:19 +0000 (22:08 +0000)]
Describe/link some of the universal driver related work.

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

15 years agoAdd a "Universal Driver" open project, and web page.
Daniel Dunbar [Sat, 17 Oct 2009 21:50:11 +0000 (21:50 +0000)]
Add a "Universal Driver" open project, and web page.

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

15 years agoWhen type-checking a C++ "new" expression, don't type-check the actual
Douglas Gregor [Sat, 17 Oct 2009 21:40:42 +0000 (21:40 +0000)]
When type-checking a C++ "new" expression, don't type-check the actual
initialization if any of the constructor/initialization arguments are
type-dependent. Fixes PR5224.

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

15 years agoWhen resolving the address of an overloaded function or function template, mark the...
Sebastian Redl [Sat, 17 Oct 2009 21:12:09 +0000 (21:12 +0000)]
When resolving the address of an overloaded function or function template, mark the result as referenced.

The most important effect of this is that function templates only referenced by address expressions now get instantiated. This, in turn, means that Hello World compiles with the Apache stdcxx library even when using endl.

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

15 years agoDon't add implicit casts of explicit address-taking of overloaded functions.
Sebastian Redl [Sat, 17 Oct 2009 20:50:27 +0000 (20:50 +0000)]
Don't add implicit casts of explicit address-taking of overloaded functions.

Taking the address of an overloaded function with an explicit address-of operator wrapped the operator in an implicit cast that added yet another pointer level, leaving us with a corrupted AST, which crashed CodeGen in the test case I've added. Fix this by making FixOverloadedFunctionReference return whether there was an address-of operator and not adding the implicit cast in that case.

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

15 years agoAdd IdentifierTable::CreateIdentifierInfo(StringRef).
Daniel Dunbar [Sat, 17 Oct 2009 20:44:06 +0000 (20:44 +0000)]
Add IdentifierTable::CreateIdentifierInfo(StringRef).

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

15 years agoUse StringExtra's HashString instead of BernsteinHash.
Daniel Dunbar [Sat, 17 Oct 2009 20:43:58 +0000 (20:43 +0000)]
Use StringExtra's HashString instead of BernsteinHash.

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

15 years agoAdd an open project. :)
Daniel Dunbar [Sat, 17 Oct 2009 20:43:50 +0000 (20:43 +0000)]
Add an open project. :)

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

15 years agodaniel really wants this in the testsuite.
Chris Lattner [Sat, 17 Oct 2009 20:37:18 +0000 (20:37 +0000)]
daniel really wants this in the testsuite.

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

15 years agoteach getCorrespondingUnsignedType how to handle vectors of integers,
Chris Lattner [Sat, 17 Oct 2009 20:33:28 +0000 (20:33 +0000)]
teach getCorrespondingUnsignedType how to handle vectors of integers,
fixing PR4838.

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

15 years agoIn some dependent contexts, incomplete array types persist into FinalizeDeclaratorGro...
Sebastian Redl [Sat, 17 Oct 2009 19:37:06 +0000 (19:37 +0000)]
In some dependent contexts, incomplete array types persist into FinalizeDeclaratorGroup. Don't require them to have a complete type. This allows us to compile Hello World with the Apache stdcxx library. If you don't use endl, it even links and runs.

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

15 years agoFix for PR5190, Credit to Zhanyong Wan.
Edward O'Callaghan [Sat, 17 Oct 2009 19:32:54 +0000 (19:32 +0000)]
Fix for PR5190, Credit to Zhanyong Wan.

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

15 years agoAdd a DR437 testcase, but disable it for now, since it fails.
Sebastian Redl [Sat, 17 Oct 2009 18:31:05 +0000 (18:31 +0000)]
Add a DR437 testcase, but disable it for now, since it fails.

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

15 years agoAvoid std::string thrashing in MultiKeywordSelector::getName(), and simplify.
Daniel Dunbar [Sat, 17 Oct 2009 18:13:02 +0000 (18:13 +0000)]
Avoid std::string thrashing in MultiKeywordSelector::getName(), and simplify.

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

15 years agoSimplify more.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:53 +0000 (18:12 +0000)]
Simplify more.

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

15 years agoSimplify.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:45 +0000 (18:12 +0000)]
Simplify.

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

15 years agoUse raw_ostream instead of C stdio.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:37 +0000 (18:12 +0000)]
Use raw_ostream instead of C stdio.

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

15 years agoRewrite AttributeList::getKind to use StringRef API.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:29 +0000 (18:12 +0000)]
Rewrite AttributeList::getKind to use StringRef API.

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

15 years agoSimplify.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:21 +0000 (18:12 +0000)]
Simplify.

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

15 years agoUse raw_ostream for formatting integers, and use IdentifierInfo::getNameStr
Daniel Dunbar [Sat, 17 Oct 2009 18:12:14 +0000 (18:12 +0000)]
Use raw_ostream for formatting integers, and use IdentifierInfo::getNameStr
instead of getName.
 - -2 FIXMEs.

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

15 years agoMinor cleanup: move typedef out of anonymous namespace (which now contains nothing...
Ted Kremenek [Sat, 17 Oct 2009 17:45:11 +0000 (17:45 +0000)]
Minor cleanup: move typedef out of anonymous namespace (which now contains nothing) and into RemoveDeadBindings.  No functionality change.

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

15 years agoWrite the preprocessor block after we write out types + declarations,
Douglas Gregor [Sat, 17 Oct 2009 17:25:45 +0000 (17:25 +0000)]
Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.

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

15 years agoSuppress -Asserts warning.
Daniel Dunbar [Sat, 17 Oct 2009 09:39:30 +0000 (09:39 +0000)]
Suppress -Asserts warning.

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

15 years agoRemove a FIXME that doesn't belong, there are numerous other places that use
Daniel Dunbar [Sat, 17 Oct 2009 09:38:57 +0000 (09:38 +0000)]
Remove a FIXME that doesn't belong, there are numerous other places that use
alignment in bits in clang. If we really want to fix this, it should be a bugzilla.

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

15 years agoSimplify (move guard to caller instead of callee).
Daniel Dunbar [Sat, 17 Oct 2009 09:04:56 +0000 (09:04 +0000)]
Simplify (move guard to caller instead of callee).

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

15 years agoPer discussion with Ted, the 'FromSuper'/'FromSub' logic is invalid. Simplify
Zhongxing Xu [Sat, 17 Oct 2009 08:39:24 +0000 (08:39 +0000)]
Per discussion with Ted, the 'FromSuper'/'FromSub' logic is invalid. Simplify
the code to standard worklist algorithm. Always add both sub and super
regions of live regions.

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

15 years agoFix another static analyzer crash due to a corner case in "folding" symbolic values...
Ted Kremenek [Sat, 17 Oct 2009 07:39:35 +0000 (07:39 +0000)]
Fix another static analyzer crash due to a corner case in "folding" symbolic values that are constrained to be a constant.

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

15 years agoActually all regions whose super region is not MemSpaceRegion are of these 3
Zhongxing Xu [Sat, 17 Oct 2009 07:32:08 +0000 (07:32 +0000)]
Actually all regions whose super region is not MemSpaceRegion are of these 3
kinds. This means we are visiting all regions 'from super region'.

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

15 years agoFix compiler warning: "ISO C90 forbids mixed declarations and code"
Ted Kremenek [Sat, 17 Oct 2009 06:42:15 +0000 (06:42 +0000)]
Fix compiler warning: "ISO C90 forbids mixed declarations and code"

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

15 years agoFix warning: 'warning: C++ style comments are not allowed in ISO C90'
Ted Kremenek [Sat, 17 Oct 2009 06:37:16 +0000 (06:37 +0000)]
Fix warning: 'warning: C++ style comments are not allowed in ISO C90'

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

15 years agoResolve FIXME: delete the 'Program' object in the destructor of CIndexer.
Ted Kremenek [Sat, 17 Oct 2009 06:21:47 +0000 (06:21 +0000)]
Resolve FIXME: delete the 'Program' object in the destructor of CIndexer.

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

15 years agoDon't crash when dumping pretty stack traces, if the current tok is an
Daniel Dunbar [Sat, 17 Oct 2009 06:13:04 +0000 (06:13 +0000)]
Don't crash when dumping pretty stack traces, if the current tok is an
annotation token.
 - I'm not sure what the best thing to print is, for now we just print the token
   location and 'at annotation token'.

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

15 years agoFix PR5211: codegen shouldn't assume that the result of ||/&& is int
Chris Lattner [Sat, 17 Oct 2009 04:24:20 +0000 (04:24 +0000)]
Fix PR5211: codegen shouldn't assume that the result of ||/&& is int
anymore.  In C++ it is bool.

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

15 years agoSimplify.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:56 +0000 (03:28 +0000)]
Simplify.

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

15 years agoAdd IdentiferInfo::getNameStr() -> StringRef.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:48 +0000 (03:28 +0000)]
Add IdentiferInfo::getNameStr() -> StringRef.

Also, add getNameStart as a synonym for getName(). getName() is now deprecated,
when all clients are updated then getNameStr() should be renamed to
getName(). PR5218.

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

15 years agoFix sentence-o.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:37 +0000 (03:28 +0000)]
Fix sentence-o.

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

15 years agoAdd Ubuntu 9.04 C++ search path.
Daniel Dunbar [Sat, 17 Oct 2009 03:19:56 +0000 (03:19 +0000)]
Add Ubuntu 9.04 C++ search path.

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

15 years agoAdd 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created...
Ted Kremenek [Sat, 17 Oct 2009 00:34:24 +0000 (00:34 +0000)]
Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created ASTContext to use
its own BumpPtrAllocator to allocate ASTs.

Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to
ASTUnit::LoadFromPCHFile().

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

15 years agoMerge the "types" and "declarations" blocks in the precompiled header
Douglas Gregor [Sat, 17 Oct 2009 00:13:19 +0000 (00:13 +0000)]
Merge the "types" and "declarations" blocks in the precompiled header
format, so that we don't end up with multiple declaration and types
blocks. Also, fix a few obscure bugs with PCH loading and generation:

  - If the DeclIDs DenseMap reallocates while we are writing a
    declaration (due to recursively writing other declarations), we
    could end up writing a bad ID to ExternalDefinitions.
  - When loading an ArrayLoc (part of DeclaratorInfo), we need to set
    the size expression to NULL if no size expression was provided.

PCH -> AST rewriting is still partly broken, unfortunately.

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

15 years agoPatch to clean up and improve visual display of
Fariborz Jahanian [Fri, 16 Oct 2009 23:25:02 +0000 (23:25 +0000)]
Patch to clean up and improve visual display of
builtin function ambiguity.

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

15 years agoWhile writing source-location entries to a PCH file, go through an
Douglas Gregor [Fri, 16 Oct 2009 22:46:09 +0000 (22:46 +0000)]
While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).

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

15 years agoAllow TypeLocs to be fully initialized with a single SourceLocation. This
John McCall [Fri, 16 Oct 2009 22:31:57 +0000 (22:31 +0000)]
Allow TypeLocs to be fully initialized with a single SourceLocation.  This
will be the keystone of converting existing rewrites to be rewrites on TypeLocs.

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

15 years agoUse VisibleQuals to control setting of Volatile/Restrict qualifiers on
Fariborz Jahanian [Fri, 16 Oct 2009 22:08:05 +0000 (22:08 +0000)]
Use VisibleQuals to control setting of Volatile/Restrict qualifiers on
candidate types in BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants
further trimming the overload candidate set.

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

15 years agoFactor out routines to encode/decode DeclaratorInfos and move them into the
John McCall [Fri, 16 Oct 2009 21:56:05 +0000 (21:56 +0000)]
Factor out routines to encode/decode DeclaratorInfos and move them into the
core PCH reader/writer implementation files.

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

15 years agoAdd an accessor to extra the type directly from a DeclaratorInfo
John McCall [Fri, 16 Oct 2009 21:42:04 +0000 (21:42 +0000)]
Add an accessor to extra the type directly from a DeclaratorInfo
without an opaque call.

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

15 years agoMake CIndex and c-index-test a little bit more robust. The only
Douglas Gregor [Fri, 16 Oct 2009 21:24:31 +0000 (21:24 +0000)]
Make CIndex and c-index-test a little bit more robust. The only
substantive change is that clang_getCursorSource() now returns the
file in which a macro was instantiated when the cursor points into a
macro instantiation, rather than crashing.

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

15 years agoFix static analyzer crash due to recently add symbolic-value constant folding. The...
Ted Kremenek [Fri, 16 Oct 2009 20:46:24 +0000 (20:46 +0000)]
Fix static analyzer crash due to recently add symbolic-value constant folding. The issue was falsely
converting the constant value of the LHS of a '<<'/'>>' operation to the same APSInt value of the
RHS.

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

15 years agoProvide 'static' version of BinaryOperator::isShiftOp().
Ted Kremenek [Fri, 16 Oct 2009 20:45:04 +0000 (20:45 +0000)]
Provide 'static' version of BinaryOperator::isShiftOp().

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

15 years agoKeep track of whether declararions were loaded from a precompiled
Douglas Gregor [Fri, 16 Oct 2009 20:01:17 +0000 (20:01 +0000)]
Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.

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

15 years agodynamic linker arg is incorrectly invoking gnu ld arg syntax instead of svr4 ld synta...
Edward O'Callaghan [Fri, 16 Oct 2009 19:44:18 +0000 (19:44 +0000)]
dynamic linker arg is incorrectly invoking gnu ld arg syntax instead of svr4 ld syntax in AuroraUX toolchain.

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

15 years agoImplement derived-to-base AST/code gen. There is a
Fariborz Jahanian [Fri, 16 Oct 2009 19:20:59 +0000 (19:20 +0000)]
Implement derived-to-base AST/code gen. There is a
FIXME in CGCXX.cpp that I would like Anders to
take a look at.

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

15 years agoAdd support for a chain of stat caches in the FileManager, rather than
Douglas Gregor [Fri, 16 Oct 2009 18:18:30 +0000 (18:18 +0000)]
Add support for a chain of stat caches in the FileManager, rather than
only supporting a single stat cache. The immediate benefit of this
change is that we can now generate a PCH/AST file when including
another PCH file; in the future, the chain of stat caches will likely
be useful with multiple levels of PCH files.

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

15 years agoImplement PR4407 - missing warnings on case value overflow,
Chris Lattner [Fri, 16 Oct 2009 16:45:22 +0000 (16:45 +0000)]
Implement PR4407 - missing warnings on case value overflow,
patch by Zhanyong Wan!

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

15 years agoignore 'using' directive in CodeGenFunction::EmitDecl(). this fixes PR5085
Nuno Lopes [Fri, 16 Oct 2009 14:40:52 +0000 (14:40 +0000)]
ignore 'using' directive in CodeGenFunction::EmitDecl(). this fixes PR5085

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

15 years agofix -ansi in c++: it means -std=c++98
Nuno Lopes [Fri, 16 Oct 2009 14:28:06 +0000 (14:28 +0000)]
fix -ansi in c++: it means -std=c++98

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

15 years agoAdd CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.
Anders Carlsson [Fri, 16 Oct 2009 05:23:41 +0000 (05:23 +0000)]
Add CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.

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

15 years agoMake CheckVectorCast return a CastKind. Reduce nesting of if statements in CheckCastT...
Anders Carlsson [Fri, 16 Oct 2009 02:48:28 +0000 (02:48 +0000)]
Make CheckVectorCast return a CastKind. Reduce nesting of if statements in CheckCastTypes.

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

15 years agoAdd a ToVoid cast kind and start using it.
Anders Carlsson [Fri, 16 Oct 2009 02:35:04 +0000 (02:35 +0000)]
Add a ToVoid cast kind and start using it.

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

15 years agoincrease helpfulness of assert message.
Chris Lattner [Fri, 16 Oct 2009 02:34:51 +0000 (02:34 +0000)]
increase helpfulness of assert message.

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

15 years agoBuiltin types are subsitutable if they are qualified. Fixes PR5196.
Anders Carlsson [Fri, 16 Oct 2009 02:06:06 +0000 (02:06 +0000)]
Builtin types are subsitutable if they are qualified. Fixes PR5196.

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

15 years agoThe result type of logical || and && is bool in C++. Fixes PR5206.
Anders Carlsson [Fri, 16 Oct 2009 01:44:21 +0000 (01:44 +0000)]
The result type of logical || and && is bool in C++. Fixes PR5206.

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

15 years agoWork-around wchar_t and __pragma problem in VC headers
John Thompson [Fri, 16 Oct 2009 01:12:00 +0000 (01:12 +0000)]
Work-around wchar_t and __pragma problem in VC headers

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

15 years agoretain/release checker: Stop tracking reference counts for any symbols touched by...
Ted Kremenek [Fri, 16 Oct 2009 00:30:49 +0000 (00:30 +0000)]
retain/release checker: Stop tracking reference counts for any symbols touched by StoreManager::InvalidateRegion().

This fixes <rdar://problem/7257223> and <rdar://problem/7283470>.

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

15 years agoRemove the ConstantArrayType subtypes. This information is preserved in the
John McCall [Fri, 16 Oct 2009 00:14:28 +0000 (00:14 +0000)]
Remove the ConstantArrayType subtypes.  This information is preserved in the
TypeLoc records for declarations;  it should not be necessary to represent it
directly in the type system.

Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.

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

15 years agoAdd a few passing test cases for finding leaks of retained objects stored to arrays...
Ted Kremenek [Thu, 15 Oct 2009 23:44:02 +0000 (23:44 +0000)]
Add a few passing test cases for finding leaks of retained objects stored to arrays (<rdar://problem/7283470>).

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

15 years agoUse an std::vector<> instead of an array of ARG_MAX size, as ARG_MAX may not be defin...
Ted Kremenek [Thu, 15 Oct 2009 23:21:22 +0000 (23:21 +0000)]
Use an std::vector<> instead of an array of ARG_MAX size, as ARG_MAX may not be defined everywhere.

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

15 years agoDisallow arbitrary custom inline asm constraints for msp430.
Anton Korobeynikov [Thu, 15 Oct 2009 23:17:13 +0000 (23:17 +0000)]
Disallow arbitrary custom inline asm constraints for msp430.

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

15 years agoImprove point-of-instantiation location information for members of class templates
Douglas Gregor [Thu, 15 Oct 2009 23:05:15 +0000 (23:05 +0000)]
Improve point-of-instantiation location information for members of class templates

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

15 years agoMake the remaining explicit-instantiation semantic action use
Douglas Gregor [Thu, 15 Oct 2009 22:53:21 +0000 (22:53 +0000)]
Make the remaining explicit-instantiation semantic action use
CheckSpecializationInstantiationRedecl to check for
redeclarations/instantiations. Also fixes a longstanding issue where
our explicit-instantiation location information wasn't as good as it
could have been.

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

15 years agoConcreteTypeLoc subclasses which call getInnerTypeLoc() should get a
John McCall [Thu, 15 Oct 2009 22:37:38 +0000 (22:37 +0000)]
ConcreteTypeLoc subclasses which call getInnerTypeLoc() should get a
compile-time error now;  moreover, remove the need for an explicit hasInnerType()
call.  Thanks to Doug Gregor for the metaprogramming approach.

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

15 years agoEducate the retain/release checker about [NSCursor dragCopyCursor].
Ted Kremenek [Thu, 15 Oct 2009 22:26:21 +0000 (22:26 +0000)]
Educate the retain/release checker about [NSCursor dragCopyCursor].
This fixes <rdar://problem/7306898>

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

15 years agoretain/release checker: Use simpler utility method for creating class method summarie...
Ted Kremenek [Thu, 15 Oct 2009 22:25:12 +0000 (22:25 +0000)]
retain/release checker: Use simpler utility method for creating class method summaries.  No functionality change.

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

15 years agoMake sure temporary files get unlinked.
Steve Naroff [Thu, 15 Oct 2009 22:23:48 +0000 (22:23 +0000)]
Make sure temporary files get unlinked.

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

15 years agoAdd missing #include for wait().
Ted Kremenek [Thu, 15 Oct 2009 22:10:56 +0000 (22:10 +0000)]
Add missing #include for wait().

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

15 years agoMinor improvement to format...no functionality change.
Steve Naroff [Thu, 15 Oct 2009 20:50:09 +0000 (20:50 +0000)]
Minor improvement to format...no functionality change.

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

15 years agoImplement <rdar://problem/7303432> [Clang/Index] In-memory-style AST generation API...
Steve Naroff [Thu, 15 Oct 2009 20:04:39 +0000 (20:04 +0000)]
Implement <rdar://problem/7303432> [Clang/Index] In-memory-style AST generation API (initial API implementation).

Added clang_createTranslationUnitFromSourceFile().
Changed clang_createIndex() to lookup the location of clang (using dladdr).

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

15 years agoDriver: Default to using PTH for C++ precompiled header support, PCH for C++
Daniel Dunbar [Thu, 15 Oct 2009 20:02:44 +0000 (20:02 +0000)]
Driver: Default to using PTH for C++ precompiled header support, PCH for C++
isn't implemented yet.
 - <rdar://problem/7297571> Clang should use pretokenized headers for C++ PCH
   files

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

15 years agoMake sure that we're diagnosing duplicate explicit instantiation definitions.
Douglas Gregor [Thu, 15 Oct 2009 18:07:02 +0000 (18:07 +0000)]
Make sure that we're diagnosing duplicate explicit instantiation definitions.

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

15 years agoSimplify checking of explicit template specialization/explicit
Douglas Gregor [Thu, 15 Oct 2009 17:21:20 +0000 (17:21 +0000)]
Simplify checking of explicit template specialization/explicit
instantiation redeclaration semantics for function template
specializations and member functions of class template
specializations. Also, record the point of instantiation for
explicit-instantiated functions and static data members.

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