]> granicus.if.org Git - clang/log
clang
12 years agoDiagnosticsEngine::setMappingToAllDiagnostics() does not need to return bool,
Argyrios Kyrtzidis [Sat, 28 Jan 2012 04:35:52 +0000 (04:35 +0000)]
DiagnosticsEngine::setMappingToAllDiagnostics() does not need to return bool,
caught by Chad.

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

12 years agoAllow the external AST source to provide a layout without specifying
Douglas Gregor [Sat, 28 Jan 2012 00:53:29 +0000 (00:53 +0000)]
Allow the external AST source to provide a layout without specifying
the alignment (because it's not encoded in DWARF). In this case, make
an educated guess at the alignment.

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

12 years agoRemove the "C" in "implicitly declaring C library function" diagnostic
Jean-Daniel Dupas [Fri, 27 Jan 2012 23:21:02 +0000 (23:21 +0000)]
Remove the "C" in "implicitly declaring C library function" diagnostic
because all functions are not C functions (i.e. NSLog).

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

12 years agoIntroduce module attributes into the module map grammar, along with a
Douglas Gregor [Fri, 27 Jan 2012 19:52:33 +0000 (19:52 +0000)]
Introduce module attributes into the module map grammar, along with a
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a system module is
considered to be a system header, so that we (for example) suppress
warnings there.

If a module is being inferred for a framework, and that framework
directory is within a system frameworks directory, infer it as a
system framework.

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

12 years agoAdded source location for the template keyword in AST template-id expressions.
Abramo Bagnara [Fri, 27 Jan 2012 09:46:47 +0000 (09:46 +0000)]
Added source location for the template keyword in AST template-id expressions.

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

12 years agoRemove redundant checks.
Jean-Daniel Dupas [Fri, 27 Jan 2012 09:14:17 +0000 (09:14 +0000)]
Remove redundant checks.

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

12 years agoAvoid redundant NNS qualification in constructor/destructor names.
Abramo Bagnara [Fri, 27 Jan 2012 08:46:19 +0000 (08:46 +0000)]
Avoid redundant NNS qualification in constructor/destructor names.

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

12 years agoAdd test for -Wno-everything.
Argyrios Kyrtzidis [Fri, 27 Jan 2012 07:10:14 +0000 (07:10 +0000)]
Add test for -Wno-everything.

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

12 years agoDue to a bug, -Wno-everything works like -Weverything. Fix the bug by having
Argyrios Kyrtzidis [Fri, 27 Jan 2012 06:15:43 +0000 (06:15 +0000)]
Due to a bug, -Wno-everything works like -Weverything. Fix the bug by having
-Wno-everything remap all warnings to ignored.

We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.

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

12 years agoIn FixItRecompile::BeginInvocation() reset the diagnostics before executing
Argyrios Kyrtzidis [Fri, 27 Jan 2012 06:15:37 +0000 (06:15 +0000)]
In FixItRecompile::BeginInvocation() reset the diagnostics before executing
the original action.

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

12 years agoReimplement (de-)serialization of Objective-C categories to eliminate
Douglas Gregor [Fri, 27 Jan 2012 01:47:08 +0000 (01:47 +0000)]
Reimplement (de-)serialization of Objective-C categories to eliminate
the direct serialization of the linked-list structure. Instead, use a
scheme similar to how we handle redeclarations, with redeclaration
lists on the side. This addresses several issues:
  - In cases involving mixing and matching of many categories across
  many modules, the linked-list structure would not be consistent
  across different modules, and categories would get lost.
  - If a module is loaded after the class definition and its other
  categories have already been loaded, we wouldn't see any categories
  in the newly-loaded module.

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

12 years agoBe sure to emit delayed diagnostics after parsing the declaration
John McCall [Fri, 27 Jan 2012 01:29:43 +0000 (01:29 +0000)]
Be sure to emit delayed diagnostics after parsing the declaration
of a for-range variable.  Fixes PR11793.

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

12 years agoconstexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
Richard Smith [Fri, 27 Jan 2012 01:14:48 +0000 (01:14 +0000)]
constexpr: Implement the [dcl.constexpr]p5 check for whether a constexpr
function definition can produce a constant expression. This also provides the
last few checks for [dcl.constexpr]p3 and [dcl.constexpr]p4.

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

12 years agoIn FixItRecompile::BeginInvocation(), check the return value of BeginSourceFile().
Argyrios Kyrtzidis [Fri, 27 Jan 2012 01:00:47 +0000 (01:00 +0000)]
In FixItRecompile::BeginInvocation(), check the return value of BeginSourceFile().

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

12 years agoPlacate gcc's -Wreturn-type
Matt Beaumont-Gay [Fri, 27 Jan 2012 00:46:27 +0000 (00:46 +0000)]
Placate gcc's -Wreturn-type

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

12 years agotest/Driver/prefixed-tools.c: Disable this on win32 hosts, msvc and mingw.
NAKAMURA Takumi [Fri, 27 Jan 2012 00:31:09 +0000 (00:31 +0000)]
test/Driver/prefixed-tools.c: Disable this on win32 hosts, msvc and mingw.

It had failed on Win32 due to inability of executing shell scripts.
Still it fails even with mingw MSYS bash.

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

12 years agotest/Driver/prefixed-tools.c: Fix newline at end-of-file.
NAKAMURA Takumi [Fri, 27 Jan 2012 00:31:03 +0000 (00:31 +0000)]
test/Driver/prefixed-tools.c: Fix newline at end-of-file.

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

12 years agoTurn off implicit truncation warning for compound assignment to bitfields; it might...
Eli Friedman [Thu, 26 Jan 2012 23:34:06 +0000 (23:34 +0000)]
Turn off implicit truncation warning for compound assignment to bitfields; it might be reasonable in some cases, but it clearly doesn't make sense in some cases, like the included testcase.

<rdar://problem/10238797>, part 2.

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

12 years agoTeach ccc-analyzer about -fobjc-abi-version.
Ted Kremenek [Thu, 26 Jan 2012 23:30:13 +0000 (23:30 +0000)]
Teach ccc-analyzer about -fobjc-abi-version.

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

12 years agoMake the bitfield implicit truncation warning slightly more aggressive, and make...
Eli Friedman [Thu, 26 Jan 2012 23:11:39 +0000 (23:11 +0000)]
Make the bitfield implicit truncation warning slightly more aggressive, and make the printed warning a bit more accurate.  The new behavior matches gcc's -Wconversion.  <rdar://problem/10238797>.

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

12 years agoRemove the ToolTriple logic in NetBSD, which was completely broken by
Joerg Sonnenberger [Thu, 26 Jan 2012 22:27:52 +0000 (22:27 +0000)]
Remove the ToolTriple logic in NetBSD, which was completely broken by
the recent refactoring. All interesting NetBSD release have a GNU as
version on i386 that supports --32, so don't bother with the conditional
setting of it.

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

12 years agoMake clz/ctz builtins defined for zero on ARM targets. rdar://10732455
Bob Wilson [Thu, 26 Jan 2012 22:14:27 +0000 (22:14 +0000)]
Make clz/ctz builtins defined for zero on ARM targets.  rdar://10732455

ARM supports clz and ctz directly and both operations have well-defined
results for zero.  There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics.  We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined.  The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255).  There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed.  For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs.  Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.

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

12 years agoRemove obviously incorrect branch.
Joerg Sonnenberger [Thu, 26 Jan 2012 21:58:37 +0000 (21:58 +0000)]
Remove obviously incorrect branch.

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

12 years agoKeep track of the original target the user specified before
Joerg Sonnenberger [Thu, 26 Jan 2012 21:56:28 +0000 (21:56 +0000)]
Keep track of the original target the user specified before
normalization. This used to be captured in DefaultTargetTriple and is
used for the (optional) $triple-$tool lookup for cross-compilation.
Do this properly by making it an attribute of the toolchain and use it
in combination with the computed triple as index for the toolchain
lookup.

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

12 years agoChange references to 'const ProgramState *' to typedef 'ProgramStateRef'.
Ted Kremenek [Thu, 26 Jan 2012 21:29:00 +0000 (21:29 +0000)]
Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.

At this point this is largely cosmetic, but it opens the door to replace
ProgramStateRef with a smart pointer that more eagerly acts in the role
of reclaiming unused ProgramState objects.

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

12 years agoobjc-arc: introduce -no-finalize-removal which in gc mode,
Fariborz Jahanian [Thu, 26 Jan 2012 20:57:58 +0000 (20:57 +0000)]
objc-arc: introduce -no-finalize-removal which in gc mode,
leaves "finalize' behind and in arc mode, does not
include it. This allows the migrated source to be compiled
in both gc and arc mode. // rdar://10532441

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

12 years agoDon't suppress access-control or invalid-type diagnostics from a
John McCall [Thu, 26 Jan 2012 20:04:03 +0000 (20:04 +0000)]
Don't suppress access-control or invalid-type diagnostics from a
declarator just because we were able to build an invalid decl
for it.  The invalid-type diagnostics, in particular, are still useful
to know, and may indicate something about why the decl is invalid.

Also, recover from an illegal pointer/reference-to-unqualified-retainable
type using __strong instead of __autoreleasing;  in general, a random
object is much more likely to be __strong, so this avoids unnecessary
cascading errors in the most common case.

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

12 years agoTry harder to get X7 defined
Douglas Gregor [Thu, 26 Jan 2012 18:38:13 +0000 (18:38 +0000)]
Try harder to get X7 defined

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

12 years agoChange HasMutableFields to HasOnlyCMembers and consider that a tag inside
Argyrios Kyrtzidis [Thu, 26 Jan 2012 18:28:08 +0000 (18:28 +0000)]
Change HasMutableFields to HasOnlyCMembers and consider that a tag inside
another tag does not break C-like-ness. rdar://10756831

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

12 years agoDon't separately serialize the list of instance variables in an
Douglas Gregor [Thu, 26 Jan 2012 17:31:14 +0000 (17:31 +0000)]
Don't separately serialize the list of instance variables in an
Objective-C class. The AST reader just throws away this data anyway!

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

12 years agoForce layout of more of the unions and structures in this test
Douglas Gregor [Thu, 26 Jan 2012 17:23:00 +0000 (17:23 +0000)]
Force layout of more of the unions and structures in this test

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

12 years agoobjc: 'id' and block pointer compare in mergeTypes is
Fariborz Jahanian [Thu, 26 Jan 2012 17:08:50 +0000 (17:08 +0000)]
objc: 'id' and block pointer compare in mergeTypes is
made symmetrical. // rdar://10734265

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

12 years agoAST/ExprConstant.cpp: Silence a warning on ms cl.exe. "bool" does not prefer to be...
NAKAMURA Takumi [Thu, 26 Jan 2012 09:37:36 +0000 (09:37 +0000)]
AST/ExprConstant.cpp: Silence a warning on ms cl.exe. "bool" does not prefer to be compared to integer.

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

12 years agoSuppress any warnings from this test. They aren't interesting, and they
Chandler Carruth [Thu, 26 Jan 2012 09:28:50 +0000 (09:28 +0000)]
Suppress any warnings from this test. They aren't interesting, and they
end up in the same output file as the layout stuff. There may even be
a race condition which is causing this output to confuse the FileCheck
in some cases. I actually don't know how on earth the parsing of the
layout file even works given that there are diagnostics in the middle of
it. ;]

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

12 years agoExtend the ExternalASTSource interface to allow the AST source to
Douglas Gregor [Thu, 26 Jan 2012 07:55:45 +0000 (07:55 +0000)]
Extend the ExternalASTSource interface to allow the AST source to
provide the layout of records, rather than letting Clang compute
the layout itself. LLDB provides the motivation for this feature:
because various layout-altering attributes (packed, aligned, etc.)
don't get reliably get placed into DWARF, the record layouts computed
by LLDB from the reconstructed records differ from the actual layouts,
and badness occurs. This interface lets the DWARF data drive layout,
so we don't need the attributes preserved to get the answer write.

The testing methodology for this change is fun. I've introduced a
variant of -fdump-record-layouts called -fdump-record-layouts-simple
that always has the simple C format and provides size/alignment/field
offsets. There is also a -cc1 option -foverride-record-layout=<file>
to take the output of -fdump-record-layouts-simple and parse it to
produce a set of overridden layouts, which is introduced into the AST
via a testing-only ExternalASTSource (called
LayoutOverrideSource). Each test contains a number of records to lay
out, which use various layout-changing attributes, and then dumps the
layouts. We then run the test again, using the preprocessor to
eliminate the layout-changing attributes entirely (which would give us
different layouts for the records), but supplying the
previously-computed record layouts. Finally, we diff the layouts
produced from the two runs to be sure that they are identical.

Note that this code makes the assumption that we don't *have* to
provide the offsets of bases or virtual bases to get the layout right,
because the alignment attributes don't affect it. I believe this
assumption holds, but if it does not, we can extend
LayoutOverrideSource to also provide base offset information.

Fixes the Clang side of <rdar://problem/10169539>.

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

12 years agoUse createRecordFwdDecl here since that's what we're doing.
Eric Christopher [Thu, 26 Jan 2012 07:11:58 +0000 (07:11 +0000)]
Use createRecordFwdDecl here since that's what we're doing.

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

12 years agoRevert previous patch unifying all of the C++ record prep in one area,
Eric Christopher [Thu, 26 Jan 2012 07:01:04 +0000 (07:01 +0000)]
Revert previous patch unifying all of the C++ record prep in one area,
the gdb testsuite complains too much about the ordering of items printed,
even if the offsets in the debug info are correct.

This reverts commit 027cb30af828f07750f9185782822297a5c57231.

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

12 years agoFix a minor bug in r148582, which made -ccc-host-triple into an alias option.
Bob Wilson [Thu, 26 Jan 2012 06:22:30 +0000 (06:22 +0000)]
Fix a minor bug in r148582, which made -ccc-host-triple into an alias option.
I'm not adding a testcase because -ccc-host-triple is slated to be removed,
but clang crashes if you try to use -ccc-host-triple without this fix.

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

12 years agoRemove another duplicated variable.
Eric Christopher [Thu, 26 Jan 2012 06:20:57 +0000 (06:20 +0000)]
Remove another duplicated variable.

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

12 years agoconstexpr: evaluate (bool)&x as true when x is a local variable or a temporary.
Richard Smith [Thu, 26 Jan 2012 04:47:34 +0000 (04:47 +0000)]
constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.

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

12 years agoRemove the headers now that ::close() is not used.
Argyrios Kyrtzidis [Thu, 26 Jan 2012 04:42:21 +0000 (04:42 +0000)]
Remove the headers now that ::close() is not used.

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

12 years agoIn FixItRewriteToTemp::RewriteFilename don't try to close the file descriptor
Argyrios Kyrtzidis [Thu, 26 Jan 2012 04:19:04 +0000 (04:19 +0000)]
In FixItRewriteToTemp::RewriteFilename don't try to close the file descriptor
with close(); return it instead.

Fixes mingw build and eliminates possible racing issues.

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

12 years ago[analyzer] The CFContainer test should only be run on x86_64.
Anna Zaks [Thu, 26 Jan 2012 04:00:23 +0000 (04:00 +0000)]
[analyzer] The CFContainer test should only be run on x86_64.

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

12 years agoRewrite/FrontendActions.cpp: Tweak to unbreak msvc.
NAKAMURA Takumi [Thu, 26 Jan 2012 03:47:18 +0000 (03:47 +0000)]
Rewrite/FrontendActions.cpp: Tweak to unbreak msvc.

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

12 years agoRevert r148249: "Make the auto-detection hack for the iOS simulator set the target...
Bob Wilson [Thu, 26 Jan 2012 03:37:03 +0000 (03:37 +0000)]
Revert r148249: "Make the auto-detection hack for the iOS simulator set the target triple correctly."

There were some problems with this, so I'm backing it out for now.

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

12 years agoImprove efficiency of Sema::MaybeBindToTemporary by working with the
Peter Collingbourne [Thu, 26 Jan 2012 03:33:51 +0000 (03:33 +0000)]
Improve efficiency of Sema::MaybeBindToTemporary by working with the
canonical type directly and adding a fast path for the common case
that the type is directly a RecordType.

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

12 years agoSimplify {Record,Enum}Type::classof.
Peter Collingbourne [Thu, 26 Jan 2012 03:33:46 +0000 (03:33 +0000)]
Simplify {Record,Enum}Type::classof.

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

12 years agoAdjust CLANG_BUILD_EXAMPLES to mean whether the examples are built
Peter Collingbourne [Thu, 26 Jan 2012 03:33:40 +0000 (03:33 +0000)]
Adjust CLANG_BUILD_EXAMPLES to mean whether the examples are built
by default, rather than whether they may be built at all.

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

12 years agoUse function pointers, rather than references, to pass Destroyers
Peter Collingbourne [Thu, 26 Jan 2012 03:33:36 +0000 (03:33 +0000)]
Use function pointers, rather than references, to pass Destroyers
around, in the process cleaning up the various gcc/msvc compiler
workarounds.

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

12 years agoAdd missing include of <unistd.h>
Douglas Gregor [Thu, 26 Jan 2012 03:20:14 +0000 (03:20 +0000)]
Add missing include of <unistd.h>

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

12 years agoAdd an additional testcase for a lambda with implicit void return type.
Eli Friedman [Thu, 26 Jan 2012 03:16:41 +0000 (03:16 +0000)]
Add an additional testcase for a lambda with implicit void return type.

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

12 years agoPost link to checker-260, which is checker-259 with some experimental checks enabled.
Ted Kremenek [Thu, 26 Jan 2012 03:02:34 +0000 (03:02 +0000)]
Post link to checker-260, which is checker-259 with some experimental checks enabled.

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

12 years agoRefactor to share code for handling return statements between lambda expressions...
Eli Friedman [Thu, 26 Jan 2012 03:00:14 +0000 (03:00 +0000)]
Refactor to share code for handling return statements between lambda expressions and block literals.  As it turns out, almost all the logic can be shared.

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

12 years agoIntroduce 3 new fixit options:
Argyrios Kyrtzidis [Thu, 26 Jan 2012 02:40:48 +0000 (02:40 +0000)]
Introduce 3 new fixit options:

-fixit-recompile
applies fixits and recompiles the result
-fixit-to-temporary
applies fixits to temporary files
-fix-only-warnings">,
    applies fixits for warnings only, not errors

Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits
without touching the original sources.

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

12 years agofix to go along with an llvm change: VMCore now returns an UndefValue
Chris Lattner [Thu, 26 Jan 2012 02:33:22 +0000 (02:33 +0000)]
fix to go along with an llvm change: VMCore now returns an UndefValue
when asking for a ConstantStruct with all undef elements.

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

12 years agoEnable several checkers under --analyze for general testing.
Ted Kremenek [Thu, 26 Jan 2012 02:27:38 +0000 (02:27 +0000)]
Enable several checkers under --analyze for general testing.

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

12 years agoTidy and remove some unused variables.
Eric Christopher [Thu, 26 Jan 2012 02:05:28 +0000 (02:05 +0000)]
Tidy and remove some unused variables.

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

12 years agoFix our handling of #pragma GCC visibility.
Rafael Espindola [Thu, 26 Jan 2012 02:02:57 +0000 (02:02 +0000)]
Fix our handling of #pragma GCC visibility.
Now the lexer just produces a token and the parser is the one responsible for
activating it.
This fixes problem like the one pr11797 where the lexer and the parser were not
in sync. This also let us be more strict on where in the file we accept
these pragmas.

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

12 years agoCollect this information together. No reason to have it split.
Eric Christopher [Thu, 26 Jan 2012 01:57:29 +0000 (01:57 +0000)]
Collect this information together. No reason to have it split.

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

12 years agoRefactor into its own function.
Eric Christopher [Thu, 26 Jan 2012 01:57:13 +0000 (01:57 +0000)]
Refactor into its own function.

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

12 years agoReintroduce r148981 with significantly improved regression test. Now it
Chandler Carruth [Thu, 26 Jan 2012 01:35:15 +0000 (01:35 +0000)]
Reintroduce r148981 with significantly improved regression test. Now it
both actually tests what it wants to, doesn't have bogus and broken
assertions in it, and is also formatted much more cleanly and
consistently. Probably still some more that can be improved here, but
its much better.

Original commit message:
----
Try to unbreak the FreeBSD toolchain's detection of 32-bit targets
inside a 64-bit freebsd machine with the 32-bit compatibility layer
installed. The FreeBSD image always has the /usr/lib32 directory, so
test for the more concrete existence of crt1.o. Also enhance the tests
for freebsd to clarify what these trees look like and exercise the new
code.

Thanks to all the FreeBSD folks for helping me understand what caused
the failure and how we might fix it. =] That helps a lot. Also, yay
build bots.

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

12 years agoStaticAnalyzer/Checkers: Fix CMake build.
NAKAMURA Takumi [Thu, 26 Jan 2012 01:14:39 +0000 (01:14 +0000)]
StaticAnalyzer/Checkers: Fix CMake build.

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

12 years ago[analyzer] Add an AST checker that checks for a common pitfall when
Anna Zaks [Thu, 26 Jan 2012 01:05:43 +0000 (01:05 +0000)]
[analyzer] Add an AST checker that checks for a common pitfall when
using CFArrayCreate & family.

Specifically, CFArrayCreate's input should be:
'A C array of the pointer-sized values to be in the new array.'

(radar://10717339)

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

12 years agoobjc: allow block pointer matching 'id' type when
Fariborz Jahanian [Thu, 26 Jan 2012 00:45:38 +0000 (00:45 +0000)]
objc: allow block pointer matching 'id' type when
they show up as argument types of two block pointers.
// rdar://10734265

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

12 years agoSlight refactoring; catch yet another case where we were missing an lvalue-to-rvalue...
Eli Friedman [Thu, 26 Jan 2012 00:26:18 +0000 (00:26 +0000)]
Slight refactoring; catch yet another case where we were missing an lvalue-to-rvalue conversion.

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

12 years agoarc migrator: Added an option to the migrator
Fariborz Jahanian [Thu, 26 Jan 2012 00:08:04 +0000 (00:08 +0000)]
arc migrator: Added an option to the migrator
unused yet.

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

12 years agoRework flushing of diagnostics to PathDiagnosticConsumer. Now all the reports are...
Ted Kremenek [Wed, 25 Jan 2012 23:47:14 +0000 (23:47 +0000)]
Rework flushing of diagnostics to PathDiagnosticConsumer.  Now all the reports are batched up before being flushed
to the underlying consumer implementation.  This allows us to unique reports across analyses to multiple functions (which
shows up with inlining).

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

12 years agoDon't stack-allocate an IntegerLiteral which can be referred to after the current...
Eli Friedman [Wed, 25 Jan 2012 23:20:27 +0000 (23:20 +0000)]
Don't stack-allocate an IntegerLiteral which can be referred to after the current method returns.  PR11744, part 2.

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

12 years agoRevert r148981 because it fails test/Driver/freebsd.c
Argyrios Kyrtzidis [Wed, 25 Jan 2012 22:55:16 +0000 (22:55 +0000)]
Revert r148981 because it fails test/Driver/freebsd.c

Original log:

Author: chandlerc <chandlerc@91177308-0d34-0410-b5e6-96231b3b80d8>
Date:   Wed Jan 25 21:32:31 2012 +0000

    Try to unbreak the FreeBSD toolchain's detection of 32-bit targets
    inside a 64-bit freebsd machine with the 32-bit compatibility layer
    installed. The FreeBSD image always has the /usr/lib32 directory, so
    test for the more concrete existence of crt1.o. Also enhance the tests
    for freebsd to clarify what these trees look like and exercise the new
    code.

    Thanks to all the FreeBSD folks for helping me understand what caused
    the failure and how we might fix it. =] That helps a lot. Also, yay
    build bots.

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

12 years agoAdd some ABI tweaks for i386-pc-win32 triple so that we return structs in an MSVC...
Eli Friedman [Wed, 25 Jan 2012 22:46:34 +0000 (22:46 +0000)]
Add some ABI tweaks for i386-pc-win32 triple so that we return structs in an MSVC-compatible way.  Patch by Joe Groff.

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

12 years agoImprove the error message slightly for files that aren't using the expected UTF-8...
Eli Friedman [Wed, 25 Jan 2012 22:34:12 +0000 (22:34 +0000)]
Improve the error message slightly for files that aren't using the expected UTF-8 encoding.  Patch by Seth Cantrell.

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

12 years agoFix a crash involving a multi-dimensional dependent VLA. PR11744.
Eli Friedman [Wed, 25 Jan 2012 22:19:07 +0000 (22:19 +0000)]
Fix a crash involving a multi-dimensional dependent VLA.  PR11744.

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

12 years agoPost open source analyzer build checker-259.
Ted Kremenek [Wed, 25 Jan 2012 22:18:04 +0000 (22:18 +0000)]
Post open source analyzer build checker-259.

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

12 years agoconstexpr: add support for anonymous struct and union members in literal types.
Richard Smith [Wed, 25 Jan 2012 22:15:11 +0000 (22:15 +0000)]
constexpr: add support for anonymous struct and union members in literal types.

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

12 years agoClean up comment.
Eric Christopher [Wed, 25 Jan 2012 21:47:09 +0000 (21:47 +0000)]
Clean up comment.

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

12 years agoTry to unbreak the FreeBSD toolchain's detection of 32-bit targets
Chandler Carruth [Wed, 25 Jan 2012 21:32:31 +0000 (21:32 +0000)]
Try to unbreak the FreeBSD toolchain's detection of 32-bit targets
inside a 64-bit freebsd machine with the 32-bit compatibility layer
installed. The FreeBSD image always has the /usr/lib32 directory, so
test for the more concrete existence of crt1.o. Also enhance the tests
for freebsd to clarify what these trees look like and exercise the new
code.

Thanks to all the FreeBSD folks for helping me understand what caused
the failure and how we might fix it. =] That helps a lot. Also, yay
build bots.

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

12 years agoAllow typo correction to be disabled in BuildOverloadedCallExpr variant.
Kaelyn Uhrain [Wed, 25 Jan 2012 21:11:35 +0000 (21:11 +0000)]
Allow typo correction to be disabled in BuildOverloadedCallExpr variant.

This suppresses typo correction for auto-generated call expressions such
as to 'begin' or 'end' within a C++0x for-range statement.

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

12 years agoRestore a tiny bit of functionality that I completely overlooked in the
Chandler Carruth [Wed, 25 Jan 2012 21:03:58 +0000 (21:03 +0000)]
Restore a tiny bit of functionality that I completely overlooked in the
Linux toolchain selection -- sorry folks. =] This should fix the Hexagon
toolchain.

However, I would point out that I see why my testing didn't catch this
-- we have no tests for Hexagon. ;]

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

12 years agoAvoid correcting unknown identifiers to types where types aren't allowed.
Kaelyn Uhrain [Wed, 25 Jan 2012 20:49:08 +0000 (20:49 +0000)]
Avoid correcting unknown identifiers to types where types aren't allowed.

Pass a typo correction callback object from ParseCastExpr to
Sema::ActOnIdExpression to be a bit more selective about what kinds of
corrections will be allowed for unknown identifiers.

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

12 years ago[driver] Do emit the diagnostics when CompilerInvocation::CreateFromArgs() fails.
Argyrios Kyrtzidis [Wed, 25 Jan 2012 20:00:43 +0000 (20:00 +0000)]
[driver] Do emit the diagnostics when CompilerInvocation::CreateFromArgs() fails.

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

12 years agoAdd custom callback object for typo correction in BuildRecoveryCallExpr.
Kaelyn Uhrain [Wed, 25 Jan 2012 18:37:44 +0000 (18:37 +0000)]
Add custom callback object for typo correction in BuildRecoveryCallExpr.

The new callback, in addition to limiting which keywords to include in
the pool of typo correction candidates, also filters out non-keyword
candidates that don't refer to (template) functions that accept the
number of arguments that are present for the call being recovered.

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

12 years agoWhen we're substituting into a function parameter pack and expect to
Douglas Gregor [Wed, 25 Jan 2012 16:15:54 +0000 (16:15 +0000)]
When we're substituting into a function parameter pack and expect to
get a function parameter pack (but don't due to weird substitutions),
complain. Fixes the last bit of PR11848.

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

12 years agoThe Linux pattern of adding all the search paths that exist doesn't seem
Chandler Carruth [Wed, 25 Jan 2012 11:24:24 +0000 (11:24 +0000)]
The Linux pattern of adding all the search paths that exist doesn't seem
to suit the FreeBSD folks. Take them back to something closer to the old
behavior. We test whether the /usr/lib32 directory exists (within the
SysRoot), and use it if so, otherwise use /usr/lib.

FreeBSD folks, let me know if this causes any problems, or if you have
further tweaks.

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

12 years agoRemove the 'ToolTriple' concept from the NetBSD toolchain along with my
Chandler Carruth [Wed, 25 Jan 2012 11:18:20 +0000 (11:18 +0000)]
Remove the 'ToolTriple' concept from the NetBSD toolchain along with my
gross hack to provide it from my previous patch removing HostInfo. This
was enshrining (and hiding from my searches) the concept of storing and
diff-ing the host and target triples. We don't have the host triple
reliably available, so we need to merely inspect the target system. I've
changed the logic in selecting library search paths for NetBSD to match
what I provided for FreeBSD -- we include both search paths, but put the
32-bit-on-64-bit-host path first so it trumps.

NetBSD maintainers, you may want to tweak this, or feel free to ask me
to tweak it. I've left a FIXME here about the challeng I see in fixing
this properly.

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

12 years agoDelete still more remnants of the now dead HostInfo. The janitoring will
Chandler Carruth [Wed, 25 Jan 2012 11:03:35 +0000 (11:03 +0000)]
Delete still more remnants of the now dead HostInfo. The janitoring will
continue until cleanliness improves.

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

12 years agoDelete the driver's HostInfo class. This abstraction just never really
Chandler Carruth [Wed, 25 Jan 2012 11:01:57 +0000 (11:01 +0000)]
Delete the driver's HostInfo class. This abstraction just never really
did anything. The two big pieces of functionality it tried to provide
was to cache the ToolChain objects for each target, and to figure out
the exact target based on the flag set coming in to an invocation.
However, it had a lot of flaws even with those goals:
 - Neither of these have anything to do with the host, or its info.
 - The HostInfo class was setup as a full blown class *hierarchy* with
   a separate implementation for each "host" OS. This required
   dispatching just to create the objects in the first place.
 - The hierarchy claimed to represent the host, when in fact it was
   based on the target OS.
 - Each leaf in the hierarchy was responsible for implementing the flag
   processing and caching, resulting in a *lot* of copy-paste code and
   quite a few bugs.
 - The caching was consistently done based on architecture alone, even
   though *any* aspect of the targeted triple might change the behavior
   of the configured toolchain.
 - Flag processing was already being done in the Driver proper,
   separating the flag handling even more than it already is.

Instead of this, we can simply have the dispatch logic in the Driver
which previously created a HostInfo object create the ToolChain objects.
Adding caching in the Driver layer is a tiny amount of code. Finally,
pulling the flag processing into the Driver puts it where it belongs and
consolidates it in one location.

The result is that two functions, and maybe 100 lines of new code
replace over 10 classes and 800 lines of code. Woot.

This also paves the way to introduce more detailed ToolChain objects for
various OSes without threading through a new HostInfo type as well, and
the accompanying boiler plate. That, of course, was the yak I started to
shave that began this entire refactoring escapade. Wheee!

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

12 years agoAdd some really minimalist freebsd testing trees and use them in the
Chandler Carruth [Wed, 25 Jan 2012 10:50:34 +0000 (10:50 +0000)]
Add some really minimalist freebsd testing trees and use them in the
freebsd test so that it's behavior isn't dependent on the filesystem of
the host running the tests. This should revive the build bots at least.
The tests and the trees still need a lot of love to make them as useful
and easy to maintain as linux-ld.c.

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

12 years agoAdd support for const pointer to literal-objc string as format attribute.
Jean-Daniel Dupas [Wed, 25 Jan 2012 10:35:33 +0000 (10:35 +0000)]
Add support for const pointer to literal-objc string as format attribute.

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

12 years agoSwitch the ToolChain types to all store a Driver reference rather than
Chandler Carruth [Wed, 25 Jan 2012 09:12:06 +0000 (09:12 +0000)]
Switch the ToolChain types to all store a Driver reference rather than
a HostInfo reference. Nothing about the HostInfo was used by any
toolchain except digging out the driver from it. This just makes that
a lot more direct. The change was accomplished entirely mechanically.
It's one step closer to removing the shim full of buggy copy/paste code
that is HostInfo.

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

12 years agotest/CodeGen/avx-builtins.c: Fix more for -Asserts.
NAKAMURA Takumi [Wed, 25 Jan 2012 09:11:21 +0000 (09:11 +0000)]
test/CodeGen/avx-builtins.c: Fix more for -Asserts.

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

12 years agoFixup r148926, for -Asserts.
NAKAMURA Takumi [Wed, 25 Jan 2012 08:58:21 +0000 (08:58 +0000)]
Fixup r148926, for -Asserts.

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

12 years agoRemove the TargetTriple object that I added to the Driver recently. This
Chandler Carruth [Wed, 25 Jan 2012 08:49:21 +0000 (08:49 +0000)]
Remove the TargetTriple object that I added to the Driver recently. This
helped stage the refactoring of things a bit, but really isn't the right
place for it. The driver may be responsible for compilations with many
different targets. In those cases, having a target triple in the driver
is actively misleading because for many of those compilations that is
not actually the triple being targeted.

This moves the last remaining users of the Driver's target triple to
instead use the ToolChain's target triple. The toolchain has a single,
concrete target it operates over, making this a more stable and natural
home for it.

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

12 years agoHave FreeBSD use even more of the same smarts as Linux is now using for
Chandler Carruth [Wed, 25 Jan 2012 08:10:33 +0000 (08:10 +0000)]
Have FreeBSD use even more of the same smarts as Linux is now using for
adding search paths. Add them only when they exist, and prefix the paths
with the sysroot. This will allow targeting a FreeBSD sysroot on
a non-FreeBSD host machine, and perhaps more importantly should allow
testing the FreeBSD driver's behavior similarly to the Linux tests with
a fake tree of files in the regression test suite.

I don't have FreeBSD systems handy to build up the list of files that
should be used here, but this is the basic functionality and I'm hoping
Roman or someone from the community can contribute the actual test
cases.

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

12 years agoSwitch FreeBSD to just include both '/usr/lib32' and '/usr/lib' in the
Chandler Carruth [Wed, 25 Jan 2012 08:04:15 +0000 (08:04 +0000)]
Switch FreeBSD to just include both '/usr/lib32' and '/usr/lib' in the
search paths for 32-bit targets. This avoids having to detect which is
expected for the target system, and the linker should DTRT, and take the
32-bit libraries from the first one when applicable. Thanks to Roman
Divacky for sanity checking this.

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

12 years agoSwitch the Linux C++ standard library header search logic over to use
Chandler Carruth [Wed, 25 Jan 2012 08:04:13 +0000 (08:04 +0000)]
Switch the Linux C++ standard library header search logic over to use
the GCC installation's multiarch suffix now that it is exposed.

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

12 years agoMake a major refactoring to how the GCC installation detection works.
Chandler Carruth [Wed, 25 Jan 2012 07:21:38 +0000 (07:21 +0000)]
Make a major refactoring to how the GCC installation detection works.

The fundamental shift here is to stop making *any* assumptions about the
*host* triple. Where these assumptions you ask? Why, they were in one of
the two target triples referenced of course. This was the single biggest
place where the previously named "host triple" was actually used as
such. ;] The reason we were reasoning about the host is in order to
detect the use of '-m32' or '-m64' flags to change the target. These
flags shift the default target only slightly, which typically means
a slight deviation from the host. When using these flags, the GCC
installation is under a different triple from the one actually targeted
in the compilation, and we used the host triple to find it.

Too bad that wasn't even correct. Consider an x86 Linux host which has
a PPC64 cross-compiling GCC toolchain installed. This toolchain is also
configured for multiarch compiling and can target PPC32 with eth '-m32'
flag. When targeting 'powerpc-linux-gnu' or some other PPC32 triple, we
have to look for the PPC64 variant of the triple to find the GCC
install, and that triple is neither the host nor target.

The new logic computes the multiarch's alternate triple from the target
triple, and looks under both sides. It also looks more aggressively for
the correct subdirectory of the GCC installation, and exposes the
subdirectory in a nice programmatic way. This '/32' or '/64' suffix is
something we can reuse in many other parts of the toolchain.

An important note -- while this likely fixes a large category of
cross-compile use cases, that's not my primary goal, and I've not done
testing (or added test cases) for scenarios that may now work. If
someone else wants to try more interesting PPC cross compiles, I'd love
to have reports. But my focus is on factoring away the references to the
"host" triple. The refactoring is my goal, and so I'm mostly relying on
the existing (pretty good) test coverage we have here.

Future patches will leverage this new functionality to factor out more
and more of the toolchain's triple manipulation.

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

12 years agoRe-enable test that was broken by r148919
Craig Topper [Wed, 25 Jan 2012 06:23:23 +0000 (06:23 +0000)]
Re-enable test that was broken by r148919

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

12 years agoFix -fmacro-backtrace-limit=0 to show the entire macro backtrace.
Ted Kremenek [Wed, 25 Jan 2012 06:07:15 +0000 (06:07 +0000)]
Fix -fmacro-backtrace-limit=0 to show the entire macro backtrace.

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

12 years agodisable this test for now.
Chris Lattner [Wed, 25 Jan 2012 05:38:06 +0000 (05:38 +0000)]
disable this test for now.

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

12 years agoreapply r148902:
Chris Lattner [Wed, 25 Jan 2012 05:34:41 +0000 (05:34 +0000)]
reapply r148902:

"use the new ConstantVector::getSplat method where it makes sense."

Also simplify a bunch of code to use the Builder->getInt32 instead
of doing it the hard and ugly way.  Much more progress could be made
here, but I don't plan to do it.

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