Compare commits
8 Commits
llvmorg-2.
...
llvmorg-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6316e8ae7 | ||
|
|
68be04bc71 | ||
|
|
52d7f0e3f1 | ||
|
|
7b339e4abc | ||
|
|
2ff2fd82c1 | ||
|
|
b802b82e6d | ||
|
|
d1b59c20e3 | ||
|
|
4b28ae0127 |
@@ -172,13 +172,28 @@ void IdentifierResolver::InsertDeclAfter(iterator Pos, NamedDecl *D) {
|
||||
DeclarationName Name = D->getDeclName();
|
||||
void *Ptr = Name.getFETokenInfo<void>();
|
||||
|
||||
if (Pos == iterator() || isDeclPtr(Ptr)) {
|
||||
// Simple case: insert at the end of the list (which is the
|
||||
// end of the stored vector).
|
||||
if (!Ptr) {
|
||||
AddDecl(D);
|
||||
return;
|
||||
}
|
||||
|
||||
if (isDeclPtr(Ptr)) {
|
||||
// We only have a single declaration: insert before or after it,
|
||||
// as appropriate.
|
||||
if (Pos == iterator()) {
|
||||
// Add the new declaration before the existing declaration.
|
||||
NamedDecl *PrevD = static_cast<NamedDecl*>(Ptr);
|
||||
RemoveDecl(PrevD);
|
||||
AddDecl(D);
|
||||
AddDecl(PrevD);
|
||||
} else {
|
||||
// Add new declaration after the existing declaration.
|
||||
AddDecl(D);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (IdentifierInfo *II = Name.getAsIdentifierInfo())
|
||||
II->setIsFromAST(false);
|
||||
|
||||
|
||||
@@ -2,17 +2,43 @@
|
||||
|
||||
// PR9463
|
||||
double *end;
|
||||
void f() {
|
||||
void f(bool b1, bool b2) {
|
||||
{
|
||||
int end = 0;
|
||||
goto end;
|
||||
end = 1;
|
||||
do {
|
||||
int end = 0;
|
||||
if (b2) {
|
||||
do {
|
||||
goto end;
|
||||
} while (b2);
|
||||
}
|
||||
end = 1;
|
||||
} while (b1);
|
||||
}
|
||||
|
||||
end:
|
||||
return;
|
||||
}
|
||||
|
||||
namespace N {
|
||||
float* end;
|
||||
void f(bool b1, bool b2) {
|
||||
{
|
||||
do {
|
||||
int end = 0;
|
||||
if (b2) {
|
||||
do {
|
||||
goto end;
|
||||
} while (b2);
|
||||
}
|
||||
end = 1;
|
||||
} while (b1);
|
||||
}
|
||||
|
||||
end:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void g() {
|
||||
end = 1; // expected-error{{assigning to 'double *' from incompatible type 'int'}}
|
||||
}
|
||||
|
||||
47
clang/test/SemaCXX/goto2.cpp
Normal file
47
clang/test/SemaCXX/goto2.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
//PR9463
|
||||
int subfun(const char *text) {
|
||||
const char *tmp = text;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void fun(const char* text) {
|
||||
int count = 0;
|
||||
bool check = true;
|
||||
|
||||
if (check)
|
||||
{
|
||||
const char *end = text;
|
||||
|
||||
if (check)
|
||||
{
|
||||
do
|
||||
{
|
||||
if (check)
|
||||
{
|
||||
count = subfun(end);
|
||||
goto end;
|
||||
}
|
||||
|
||||
check = !check;
|
||||
}
|
||||
while (check);
|
||||
}
|
||||
// also works, after commenting following line of source code
|
||||
int e = subfun(end);
|
||||
}
|
||||
end:
|
||||
if (check)
|
||||
++count;
|
||||
}
|
||||
|
||||
const char *text = "some text";
|
||||
|
||||
int main() {
|
||||
const char *ptr = text;
|
||||
|
||||
fun(ptr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -31,12 +31,12 @@ dnl===
|
||||
dnl===-----------------------------------------------------------------------===
|
||||
dnl Initialize autoconf and define the package name, version number and
|
||||
dnl email address for reporting bugs.
|
||||
AC_INIT([[llvm]],[[2.9svn]],[llvmbugs@cs.uiuc.edu])
|
||||
AC_INIT([[llvm]],[[2.9]],[llvmbugs@cs.uiuc.edu])
|
||||
|
||||
dnl Provide a copyright substitution and ensure the copyright notice is included
|
||||
dnl in the output of --version option of the generated configure script.
|
||||
AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign."])
|
||||
AC_COPYRIGHT([Copyright (c) 2003-2010 University of Illinois at Urbana-Champaign.])
|
||||
AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2011 University of Illinois at Urbana-Champaign."])
|
||||
AC_COPYRIGHT([Copyright (c) 2003-2011 University of Illinois at Urbana-Champaign.])
|
||||
|
||||
dnl Indicate that we require autoconf 2.59 or later. Ths is needed because we
|
||||
dnl use some autoconf macros only available in 2.59.
|
||||
@@ -411,7 +411,7 @@ dnl===-----------------------------------------------------------------------===
|
||||
|
||||
dnl --enable-optimized : check whether they want to do an optimized build:
|
||||
AC_ARG_ENABLE(optimized, AS_HELP_STRING(
|
||||
--enable-optimized,[Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
|
||||
--enable-optimized,[Compile with optimizations enabled (default is YES)]),,enableval=$optimize)
|
||||
if test ${enableval} = "no" ; then
|
||||
AC_SUBST(ENABLE_OPTIMIZED,[[]])
|
||||
else
|
||||
@@ -429,7 +429,7 @@ fi
|
||||
|
||||
dnl --enable-assertions : check whether they want to turn on assertions or not:
|
||||
AC_ARG_ENABLE(assertions,AS_HELP_STRING(
|
||||
--enable-assertions,[Compile with assertion checks enabled (default is YES)]),, enableval="yes")
|
||||
--enable-assertions,[Compile with assertion checks enabled (default is NO)]),, enableval="no")
|
||||
if test ${enableval} = "yes" ; then
|
||||
AC_SUBST(DISABLE_ASSERTIONS,[[]])
|
||||
else
|
||||
|
||||
25
llvm/configure
vendored
25
llvm/configure
vendored
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.60 for llvm 2.9svn.
|
||||
# Generated by GNU Autoconf 2.60 for llvm 2.9.
|
||||
#
|
||||
# Report bugs to <llvmbugs@cs.uiuc.edu>.
|
||||
#
|
||||
@@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='llvm'
|
||||
PACKAGE_TARNAME='-llvm-'
|
||||
PACKAGE_VERSION='2.9svn'
|
||||
PACKAGE_STRING='llvm 2.9svn'
|
||||
PACKAGE_VERSION='2.9'
|
||||
PACKAGE_STRING='llvm 2.9'
|
||||
PACKAGE_BUGREPORT='llvmbugs@cs.uiuc.edu'
|
||||
|
||||
ac_unique_file="lib/VMCore/Module.cpp"
|
||||
@@ -1328,7 +1328,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures llvm 2.9svn to adapt to many kinds of systems.
|
||||
\`configure' configures llvm 2.9 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1394,7 +1394,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of llvm 2.9svn:";;
|
||||
short | recursive ) echo "Configuration of llvm 2.9:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1402,10 +1402,9 @@ Optional Features:
|
||||
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
|
||||
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
|
||||
--enable-polly Use polly if available (default is YES)
|
||||
--enable-optimized Compile with optimizations enabled (default is NO)
|
||||
--enable-optimized Compile with optimizations enabled (default is YES)
|
||||
--enable-profiling Compile with profiling enabled (default is NO)
|
||||
--enable-assertions Compile with assertion checks enabled (default is
|
||||
YES)
|
||||
--enable-assertions Compile with assertion checks enabled (default is NO)
|
||||
--enable-expensive-checks
|
||||
Compile with expensive debug checks enabled (default
|
||||
is NO)
|
||||
@@ -1551,7 +1550,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
llvm configure 2.9svn
|
||||
llvm configure 2.9
|
||||
generated by GNU Autoconf 2.60
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@@ -1567,7 +1566,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by llvm $as_me 2.9svn, which was
|
||||
It was created by llvm $as_me 2.9, which was
|
||||
generated by GNU Autoconf 2.60. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -4774,7 +4773,7 @@ fi
|
||||
if test "${enable_assertions+set}" = set; then
|
||||
enableval=$enable_assertions;
|
||||
else
|
||||
enableval="yes"
|
||||
enableval="no"
|
||||
fi
|
||||
|
||||
if test ${enableval} = "yes" ; then
|
||||
@@ -22942,7 +22941,7 @@ exec 6>&1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by llvm $as_me 2.9svn, which was
|
||||
This file was extended by llvm $as_me 2.9, which was
|
||||
generated by GNU Autoconf 2.60. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -22995,7 +22994,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF
|
||||
ac_cs_version="\\
|
||||
llvm config.status 2.9svn
|
||||
llvm config.status 2.9
|
||||
configured by $0, generated by GNU Autoconf 2.60,
|
||||
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
||||
@@ -736,6 +736,7 @@ revision), you can checkout it from the '<tt>tags</tt>' directory (instead of
|
||||
subdirectories of the '<tt>tags</tt>' directory:</p>
|
||||
|
||||
<ul>
|
||||
<li>Release 2.9: <b>RELEASE_29</b></li>
|
||||
<li>Release 2.8: <b>RELEASE_28</b></li>
|
||||
<li>Release 2.7: <b>RELEASE_27</b></li>
|
||||
<li>Release 2.6: <b>RELEASE_26</b></li>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -340,24 +340,35 @@ static bool isCompleteOverwrite(const AliasAnalysis::Location &Later,
|
||||
// Okay, we have stores to two completely different pointers. Try to
|
||||
// decompose the pointer into a "base + constant_offset" form. If the base
|
||||
// pointers are equal, then we can reason about the two stores.
|
||||
int64_t Off1 = 0, Off2 = 0;
|
||||
const Value *BP1 = GetPointerBaseWithConstantOffset(P1, Off1, TD);
|
||||
const Value *BP2 = GetPointerBaseWithConstantOffset(P2, Off2, TD);
|
||||
int64_t EarlierOff = 0, LaterOff = 0;
|
||||
const Value *BP1 = GetPointerBaseWithConstantOffset(P1, EarlierOff, TD);
|
||||
const Value *BP2 = GetPointerBaseWithConstantOffset(P2, LaterOff, TD);
|
||||
|
||||
// If the base pointers still differ, we have two completely different stores.
|
||||
if (BP1 != BP2)
|
||||
return false;
|
||||
|
||||
// Otherwise, we might have a situation like:
|
||||
// store i16 -> P + 1 Byte
|
||||
// store i32 -> P
|
||||
// In this case, we see if the later store completely overlaps all bytes
|
||||
// stored by the previous store.
|
||||
if (Off1 < Off2 || // Earlier starts before Later.
|
||||
Off1+Earlier.Size > Off2+Later.Size) // Earlier goes beyond Later.
|
||||
return false;
|
||||
// Otherwise, we have complete overlap.
|
||||
return true;
|
||||
|
||||
// The later store completely overlaps the earlier store if:
|
||||
//
|
||||
// 1. Both start at the same offset and the later one's size is greater than
|
||||
// or equal to the earlier one's, or
|
||||
//
|
||||
// |--earlier--|
|
||||
// |-- later --|
|
||||
//
|
||||
// 2. The earlier store has an offset greater than the later offset, but which
|
||||
// still lies completely within the later store.
|
||||
//
|
||||
// |--earlier--|
|
||||
// |----- later ------|
|
||||
//
|
||||
// We have to be careful here as *Off is signed while *.Size is unsigned.
|
||||
if (EarlierOff >= LaterOff &&
|
||||
uint64_t(EarlierOff - LaterOff) + Earlier.Size <= Later.Size)
|
||||
return true;
|
||||
|
||||
// Otherwise, they don't completely overlap.
|
||||
return false;
|
||||
}
|
||||
|
||||
/// isPossibleSelfRead - If 'Inst' might be a self read (i.e. a noop copy of a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
; RUN: llc < %s -march=x86-64 > %t
|
||||
; RUN: llc < %s -mtriple=x86_64-linux > %t
|
||||
; RUN: grep {movzbl %\[abcd\]h,} %t | count 8
|
||||
; RUN: grep {%\[abcd\]h} %t | not grep {%r\[\[:digit:\]\]*d}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
; RUN: opt < %s -basicaa -dse -S | FileCheck %s
|
||||
; PR9561
|
||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"
|
||||
target triple = "i386-apple-darwin9.8"
|
||||
|
||||
@A = external global [0 x i32]
|
||||
|
||||
declare cc10 void @Func2(i32*, i32*, i32*, i32)
|
||||
|
||||
define cc10 void @Func1(i32* noalias %Arg1, i32* noalias %Arg2, i32* %Arg3, i32 %Arg4) {
|
||||
entry:
|
||||
store i32 add (i32 ptrtoint ([0 x i32]* @A to i32), i32 1), i32* %Arg2
|
||||
; CHECK: store i32 add (i32 ptrtoint ([0 x i32]* @A to i32), i32 1), i32* %Arg2
|
||||
%ln2gz = getelementptr i32* %Arg1, i32 14
|
||||
%ln2gA = bitcast i32* %ln2gz to double*
|
||||
%ln2gB = load double* %ln2gA
|
||||
%ln2gD = getelementptr i32* %Arg2, i32 -3
|
||||
%ln2gE = bitcast i32* %ln2gD to double*
|
||||
store double %ln2gB, double* %ln2gE
|
||||
; CHECK: store double %ln2gB, double* %ln2gE
|
||||
tail call cc10 void @Func2(i32* %Arg1, i32* %Arg2, i32* %Arg3, i32 %Arg4) nounwind
|
||||
ret void
|
||||
}
|
||||
Reference in New Issue
Block a user