Skip to content

Corrections for 675 #687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 148 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
506505e
 added test cases related to classes pattern and matcher
lucasccordeiro Feb 22, 2017
b6c54a6
 added test cases related to string methods replaceFirst, replaceAll …
lucasccordeiro Feb 22, 2017
9e6ea68
 added character static methods for testing characters and converting…
lucasccordeiro Feb 22, 2017
0b05615
 added test cases related to sringBuilder append methods
lucasccordeiro Feb 22, 2017
5018776
 added stringBuilder methods length, setLength, capacity and ensureCa…
lucasccordeiro Feb 22, 2017
c869809
 added stringBuilder methods charAt, setCharAt, getChars and reverse
lucasccordeiro Feb 22, 2017
c7bcdf4
 added test cases related to stringBuilder constructors
lucasccordeiro Feb 22, 2017
2026b14
 added stringBuilder methods insert, delete and deleteCharAt
lucasccordeiro Feb 22, 2017
77ca2d1
 added string methods equals, equalsIgnoreCase, compareTo and regionM…
lucasccordeiro Feb 22, 2017
48a1df8
 added test cases related to string method concat
lucasccordeiro Feb 22, 2017
cd1d392
 added test cases related to string class constructors
lucasccordeiro Feb 22, 2017
f0cffa6
 added string searching methods indexOf and lastIndexOf
lucasccordeiro Feb 22, 2017
b5d6a13
 added string methods length, position, replace, toUpperCase, toLower…
lucasccordeiro Feb 22, 2017
ccf8410
 added test cases related to string startsWith and endsWith
lucasccordeiro Feb 22, 2017
846f168
 added test cases related to string valueOf methods
lucasccordeiro Feb 22, 2017
47dbc2e
 added test cases related to string class substring methods
lucasccordeiro Feb 22, 2017
b8f2f5a
 added test cases related to StringTokenizer object used to tokenize …
lucasccordeiro Feb 22, 2017
02df7f1
 added test cases related to validate data from user using the Valida…
lucasccordeiro Feb 22, 2017
4fc5780
cleanup aa-path-symex and aa-symex
Feb 27, 2017
fdd8121
Fix failing travis tests after removal of aa-symex.
Feb 27, 2017
895f8a6
Skip already-loaded Java classes
smowton Oct 24, 2016
777d52e
Convert Java methods only when they have a caller
smowton Nov 1, 2016
b7a7bfb
Remove dead global variables
smowton Nov 1, 2016
caf804e
Restrict virtual method targets to known-created types
smowton Nov 2, 2016
6e1133d
Mark all classes in root jar reachable if it doesn't declare a main f…
smowton Nov 21, 2016
49bfea4
Add this-parameter before determining needed classes
smowton Nov 23, 2016
e12448b
Lazy method conversion: load callee parent classes
smowton Nov 30, 2016
d20bdc6
Always assume String, Class and Object are callable
smowton Jan 17, 2017
93af038
Don't try to call an abstract function
smowton Jan 17, 2017
21decbb
Make lazy method loading optional
smowton Jan 25, 2017
2f47cba
Add CBMC lazy-methods parameter
smowton Feb 6, 2017
311806e
Document lazy methods
smowton Feb 9, 2017
4910520
Style fixes
smowton Feb 9, 2017
9474d56
Add lazy loading tests
smowton Feb 9, 2017
5c5bd7a
Improve code style
smowton Feb 13, 2017
86bef23
Use safe pointers for optional arguments
smowton Feb 15, 2017
ffef5d7
Add lazy conversion documentation
smowton Feb 15, 2017
a30720b
Improve failed test printer
smowton Feb 15, 2017
8809a4c
Remove aa-symex from DIRS variable in Makefile
Feb 28, 2017
6c0ff32
Don't allowing functions called from _Start to be inlined
Nov 29, 2016
d47d503
Get symbol of member expression
dcattaruzza Oct 25, 2016
27153d1
Auxiliary function to check if the ssa has enough data to build an id…
dcattaruzza Oct 25, 2016
2987406
Bitwise operators for mpinteger
dcattaruzza Oct 25, 2016
d81dd75
Auxiliary function to retrieve tail of trace and added dead command t…
dcattaruzza Oct 25, 2016
7fb8174
Fix arithmetic shift operators
smowton Jan 13, 2017
fb616c5
Added a new class for handling the internals
Jan 16, 2017
fc756f3
Adding more symbols that should be excluded
Jan 16, 2017
2f5b866
Autocomplete script for bash
forejtv Jan 20, 2017
d485c88
Factor class identifier extraction out of remove virtuals
smowton Jan 25, 2017
99eb1a0
Discover lexical scopes for anonymous variables
smowton Jan 24, 2017
7ac505d
loop unwinding in static init of Java enum
mgudemann Jan 20, 2017
0cf34af
Support for Java assume
cristina-david Feb 9, 2017
1436e39
Regression tests for Java assume
cristina-david Feb 9, 2017
5c30907
Remove assume as coverage target
cristina-david Sep 20, 2016
e55f20b
output covered lines as CSV in show_properties
Feb 1, 2017
2ae1f47
compress list of lines into line ranges
Feb 13, 2017
f5f47a7
add regression test for coverage lines
Feb 15, 2017
02d2b9d
fix problem with missing comma / range fix for reaching end
Feb 17, 2017
b7d828b
Updated dump-C to use the new class
Jan 16, 2017
8ae50cd
Merge pull request #579 from peterschrammel/test-gen-support
peterschrammel Mar 2, 2017
fef1fed
update interpreter
Mar 2, 2017
60744ee
Merge pull request #580 from mgudemann/update_interpreter
peterschrammel Mar 2, 2017
1cbd032
Merge branch 'master' of github.com:diffblue/cbmc into update-from-ma…
peterschrammel Mar 2, 2017
5a33d91
Merge pull request #582 from peterschrammel/update-from-master
peterschrammel Mar 3, 2017
c09db52
Generate stub method for opaque functions
Dec 1, 2016
35d847b
Don't create stub for CPROVER_ functions
Dec 2, 2016
53f4a99
Create stub argument identifiers for functions with parameters
Dec 2, 2016
18b1445
Pass the whole parameter in when generating the symbol
Dec 2, 2016
dddb552
Refactored method for generating return symbol name to languaget
Dec 5, 2016
e11fd63
Added a flag for enabling opaque method stubs
Jan 17, 2017
a1014a1
Use the system_library_symbols when generating stubs
Jan 16, 2017
4e6b2a2
Added comment explaining the type of symbols we aren't stubbing
Jan 19, 2017
e2614ef
Adding simple regression for struct function
Nov 8, 2016
fa73b8b
Use the symbol in expr2c
Dec 9, 2016
8dd297e
Call the generate_opqaue_stubs from final
Mar 10, 2017
8236166
Changes to get java compiling
Mar 7, 2017
055f515
extend java_bytecode for test-gen-support
Mar 10, 2017
ae5282b
generate goals only if they do not exist in the json file
lucasccordeiro Sep 2, 2016
ead4b23
add more test cases to check existing coverage
lucasccordeiro Sep 5, 2016
b128a59
default variant of instrument_cover_goals that uses an empty set of e…
lucasccordeiro Sep 6, 2016
143b53e
a goal should be identified by a source_locationt
lucasccordeiro Sep 6, 2016
f70eadf
implement get_coverage method
lucasccordeiro Sep 6, 2016
eff4b71
a goal should be identified by a source_locationt
lucasccordeiro Sep 6, 2016
a91860a
method to construct a coverage_goalst object
lucasccordeiro Sep 6, 2016
6bf5c14
use json file suggested at github issue #187
lucasccordeiro Sep 8, 2016
51ecf51
add consider_goals method
lucasccordeiro Sep 14, 2016
2440baf
add the --no-trivial-tests option to CBMC
lucasccordeiro Sep 14, 2016
7e71a71
do not produce test goals for constructor and destructor methods
lucasccordeiro Sep 15, 2016
6cc36c1
added CPROVER_initialize
lucasccordeiro Mar 14, 2017
2cc423e
added json to cegis makefile
lucasccordeiro Mar 15, 2017
2f06442
Add json->irep deserialization routine
smowton Feb 23, 2017
4cb8705
set EXIT to 10 to all failing string-solver test cases
lucasccordeiro Mar 3, 2017
bbe06ad
Java checkcast: fix stack when check disabled
smowton Nov 30, 2016
4854c9a
initial support for miniz
Feb 14, 2017
7d2536d
use amalgamated files from release tarball
Feb 23, 2017
c2a8fb2
type cleanup in miniz
Feb 23, 2017
1dd43f6
update Makefiles / remove all references to libzip/zlib
Feb 14, 2017
8e3f681
regression test with multiple JARs/classpath
Feb 14, 2017
85889e9
disable unaligned load/store for g++
Feb 23, 2017
c384ff7
auto-fix cpplint errors with generated sed script
Feb 23, 2017
7d73d66
libzip/zlib download no longer needed
Mar 8, 2017
f430ec5
Fixed compilation issues on MinGW
pkesseli Mar 8, 2017
6861a58
remove `<regex>` from unapproved headers in cpplint
Mar 9, 2017
4d31606
Use remove_instanceof in driver programs
smowton Dec 14, 2016
206f7f4
Added a side effect expr that pushes/pops Java try-catch handlers + i…
cristina-david Feb 8, 2017
ebf9002
Regression tests for exception handling
cristina-david Dec 15, 2016
a076918
Recreate the try-catch structure from the exception table
cristina-david Feb 8, 2017
33c8e37
Remove throw/try-catch and add the required instrumentation
cristina-david Dec 14, 2016
05f2233
Moved Java exceptions regression tests
cristina-david Feb 15, 2017
58a0763
Escaping brackets in test descriptions
cristina-david Feb 17, 2017
50dfffb
Fixed test description for cbmc-java/virtual7
cristina-david Feb 17, 2017
6f5d640
Recompute live ranges for local variables and add corresponding DEAD …
cristina-david Feb 28, 2017
d0d2036
Forced try-catch to start a new basic block
cristina-david Feb 28, 2017
18fa65d
Restructuring such that the exceptions instrumentation is added in on…
cristina-david Mar 2, 2017
0a11374
Add jump to the end of the current function if a function call throws…
cristina-david Mar 2, 2017
8d2a26b
Modified the expected goto-program for cbmc-java/virtual7 as exceptio…
cristina-david Mar 2, 2017
28d00eb
+ regression test for Java exception handling
cristina-david Mar 2, 2017
15fd106
allow regex to limit class files loaded from JAR
Mar 4, 2017
6de183b
support class load configuration via JSON file
Mar 7, 2017
898ba0c
add jars from JSON config to classpath
Mar 7, 2017
52952bb
add regression test
Mar 7, 2017
aec47b7
take comments into account
Mar 10, 2017
039ac4d
change from vector indices to map
Mar 10, 2017
db28587
Explore matching nested bracketed stuff
rjmunro Feb 16, 2017
32f91b8
Fix ; after } errors
rjmunro Feb 20, 2017
0f69c93
Fix missing space after , errors
rjmunro Feb 20, 2017
f1a99f7
Replace tabs globally within the line
rjmunro Feb 20, 2017
5baa807
Add space after comma globally within the line
rjmunro Mar 3, 2017
712f94f
Remove the top variable from the cfg_dominator analysis.
Feb 10, 2017
0381aab
Support for Linux based on musl-libc.
Mar 10, 2017
dcd0c52
Add test for Alpine linux (musl-libc).
Mar 10, 2017
c337363
Merge pull request #631 from peterschrammel/update-from-master
peterschrammel Mar 15, 2017
1aede78
Preprocessing of goto programs for string refinement
romainbrenguier Dec 31, 2016
3a2e210
Moving is_java_string_type functions to string_preprocess
romainbrenguier Feb 17, 2017
70af9ce
Moving refined_string_type to util
romainbrenguier Feb 24, 2017
2929d7f
Removed distinction between c string type and refined string type
romainbrenguier Feb 27, 2017
5cb0e5e
Removed mention of c string type
romainbrenguier Feb 27, 2017
aa8c91e
Update test-gen-support from master
peterschrammel Mar 20, 2017
c362a26
Merge pull request #660 from peterschrammel/pull-from-master
forejtv Mar 21, 2017
e81a5e0
Merge pull request #669 from romainbrenguier/string-refine-preprocessing
forejtv Mar 22, 2017
72ad6ad
Making add_string_type more generic
romainbrenguier Feb 7, 2017
c9ff379
new identifier for converting char pointer to array
romainbrenguier Mar 9, 2017
a04dc21
Many corrections in preprocessing of strings
romainbrenguier Feb 17, 2017
bdbeaf5
Many corrections in string refinement
romainbrenguier Feb 28, 2017
6958a56
Need to assign length before calls since it can be overwritten by fun…
romainbrenguier Mar 22, 2017
29d67d3
Merge pull request #679 from diffblue/master
forejtv Mar 22, 2017
e4e26d8
Merge pull request #675 from allredj/testgen-string-refine-correction…
peterschrammel Mar 23, 2017
df03a01
Corrections on PR 675
Mar 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions regression/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests.log
Binary file added regression/cbmc-java/assume1/Assume1.class
Binary file not shown.
10 changes: 10 additions & 0 deletions regression/cbmc-java/assume1/Assume1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.cprover.CProver;

class Assume1
{
static void foo(int x)
{
CProver.assume(x>3);
assert x>0;
}
}
8 changes: 8 additions & 0 deletions regression/cbmc-java/assume1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Assume1.class
--function Assume1.foo
^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
Binary file added regression/cbmc-java/assume2/Assume2.class
Binary file not shown.
10 changes: 10 additions & 0 deletions regression/cbmc-java/assume2/Assume2.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.cprover.CProver;

class Assume2
{
static void foo(int x)
{
CProver.assume(x>3);
assert x>4;
}
}
8 changes: 8 additions & 0 deletions regression/cbmc-java/assume2/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Assume2.class
--function Assume2.foo
^EXIT=10$
^SIGNAL=0$
^VERIFICATION FAILED$
--
^warning: ignoring
Binary file added regression/cbmc-java/assume3/Assume3.class
Binary file not shown.
10 changes: 10 additions & 0 deletions regression/cbmc-java/assume3/Assume3.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.cprover.CProver;

class Assume3
{
public static void main(String[] args)
{
CProver.assume(false);
assert false;
}
}
8 changes: 8 additions & 0 deletions regression/cbmc-java/assume3/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CORE
Assume3.class

^EXIT=0$
^SIGNAL=0$
^VERIFICATION SUCCESSFUL$
--
^warning: ignoring
Binary file added regression/cbmc-java/covered1/covered1.class
Binary file not shown.
37 changes: 37 additions & 0 deletions regression/cbmc-java/covered1/covered1.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
public class covered1
{
// this is a variable
int x=1;
//these are two, one line off the first
int y=2;
int z=3;
//this is part of static init
static int z0=0;

//another non-static
int a;
int b;
static boolean odd;

static
{
odd=(z0+1)%2==0;
}

covered1(int a, int b)
{
this.a=a*b;
this.b=a+b;
if(this.a==a)
z0++;
else
odd=!odd;
}
// at the back
int z1=2;
int z2=3;
int z3=4;
//
static int z4=5;
int z5=5;
}
19 changes: 19 additions & 0 deletions regression/cbmc-java/covered1/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
CORE
covered1.class
--cover location --json-ui --show-properties
^EXIT=0$
^SIGNAL=0$
.*\"coveredLines\": \"22\",$
.*\"coveredLines\": \"4,6,7,23-25,31-33,36\",$
.*\"coveredLines\": \"26\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"28\",$
.*\"coveredLines\": \"29\",$
.*\"coveredLines\": \"9,18\",$
.*\"coveredLines\": \"18\",$
.*\"coveredLines\": \"18\",$
.*\"coveredLines\": \"18,35\",$
--
^warning: ignoring
1 change: 1 addition & 0 deletions scripts/bash-autocomplete/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cbmc.sh
31 changes: 31 additions & 0 deletions scripts/bash-autocomplete/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# CBMC Autocomplete Scripts for Bash
This directory contains an autocomplete script for bash.
## Installation
1. Compile cbmc and

2. `cd scripts/bash-autocomplete`

3. `./extract-switches.sh`

4. Put the following at the end of you in your `~/.bashrc`, with the directories adapted to your directory structure:
```bash
cbmcautocomplete=~/diffblue/cbmc/scripts/bash-autocomplete/cbmc.sh
if [ -f $cbmcautocomplete ]; then
. $cbmcautocomplete
fi
```
## Usage
As with the usual autocomplete in bash, start typing a switch to complete it, for example:
```
cbmc --clas<TAB>
```
will complete to
```
cbmc --classpath
```

## Features implemented

* Completing all switches
* Completing values for `--cover`, `--mm` and `--arch`
* When completing a name of a file to analyze, only files with supported extensions are shown.
43 changes: 43 additions & 0 deletions scripts/bash-autocomplete/cbmc.sh.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash
_cbmc_autocomplete()
{
#list of all switches cbmc has. IMPORTANT: in the template file, this variable must be defined on line 5.
local switches=""
#word on which the cursor is
local cur=${COMP_WORDS[COMP_CWORD]}
#previous word (in case it is a switch with a parameter)
local prev=${COMP_WORDS[COMP_CWORD-1]}

#check if the command before cursor is a switch that takes parameters, if yes,
#offer a choice of parameters
case "$prev" in
--cover) #for coverage we list the options explicitly
COMPREPLY=( $( compgen -W "assertion path branch location decision condition mcdc cover" -- $cur ) )
return 0
;;
--mm) #for memory models we list the options explicitly
COMPREPLY=( $( compgen -W "sc tso pso" -- $cur ) )
return 0
;;
--arch) #for architecture we list the options explicitly
COMPREPLY=( $( compgen -W "i386 x86_64" -- $cur ) )
return 0
;;
-I|--classpath|-cp|--outfile|--existing-coverage|--graphml-cex)
#a switch that takes a file parameter of which we don't know an extension
#TODO probably we can do more for -I, --classpath, -cp
_filedir
return 0
;;
esac

#complete a switch from a standard list, if the parameter under cursor starts with a hyphen
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W "$switches" -- $cur ) )
return 0
fi

#if none of the above applies, offer directories and files that we can analyze
_filedir "@(class|jar|cpp|cc|c\+\+|ii|cxx|c|i|gb)"
}
complete -F _cbmc_autocomplete cbmc
48 changes: 48 additions & 0 deletions scripts/bash-autocomplete/extract_switches.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
echo "Compiling the helper file to extract the raw list of parameters from cbmc"
g++ -c -MMD -MP -std=c++11 -Wall -I ../../src/ -ftrack-macro-expansion=0 -fno-diagnostics-show-caret switch_extractor_helper.c -o tmp.o 2> pragma.txt

retval=$?

#clean up compiled files, we don't need them.
rm tmp.o 2> /dev/null
rm tmp.d 2> /dev/null

#check if compilation went fine
if [ $retval -ne 0 ]; then
echo "Problem compiling the helper file, parameter list not extracted."
exit 1;
fi

echo "Converting the raw parameter list to the format required by autocomplete scripts"
rawstring=`sed "s/^.*pragma message: \(.*\)/\1/" pragma.txt`
#delete pragma file, we won't need it
rm pragma.txt 2> /dev/null

#now the main bit, convert from raw format to a proper list of switches
cleanstring=`(
#extract 2-hyphen switches, such as --foo
#grep for '(foo)' expressions, and then use sed to remove parantheses and put '--' at the start
(echo $rawstring | grep -o "([^)]*)" | sed "s/^.\(.*\).$/--\1/") ;
#extract 1-hyphen switches, such as -F
#use sed to remove all (foo) expressions, then you're left with switches and ':', so grep the colons out and then use sed to include the '-'
(echo $rawstring | sed "s/([^)]*)//g" | grep -o "[a-zA-Z0-9]" | sed "s/\(.*\)/-\1/")
) | tr '\n' ' '`

#sanity check that there is only one line of output
if [ `echo $cleanstring | wc -l | awk '{print $1}'` -ne 1 ]; then
echo "Problem converting the parameter list to the correct format, I was expecting one line but either got 0 or >2. This is likely to be an error in this conversion script."
exit 1;
fi

#sanity check that there are no dangerous characters
echo $cleanstring | grep -q "[^a-zA-Z0-9 -]"
if [ $? -eq 0 ]; then
echo "Problem converting the parameter list to the correct format, illegal characters detected. This is likely to be an error in this conversion script."
exit 1;
fi

echo "Injecting the parameter list to the autocomplete file."
sed "5 s/.*/ local switches=\"$cleanstring\"/" cbmc.sh.template > cbmc.sh

rm pragma.txt 2> /dev/null
3 changes: 3 additions & 0 deletions scripts/bash-autocomplete/switch_extractor_helper.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "cbmc/cbmc_parse_options.h"

#pragma message CBMC_OPTIONS
10 changes: 9 additions & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,12 @@ glucose-download:
@(cd ../glucose-syrup; patch -p1 < ../scripts/glucose-syrup-patch)
@rm glucose-syrup.tgz

.PHONY: minisat2-download glucose-download
cprover-jar-build:
@echo "Building org.cprover.jar"
@(cd java_bytecode/library/; \
mkdir -p target; \
javac -d target/ `find src/ -name "*.java"`; \
cd target; jar cf org.cprover.jar `find . -name "*.class"`; \
mv org.cprover.jar ../../../)

.PHONY: minisat2-download glucose-download cprover-jar-build
2 changes: 2 additions & 0 deletions src/ansi-c/ansi_c_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ Function: ansi_c_languaget::final

bool ansi_c_languaget::final(symbol_tablet &symbol_table)
{
generate_opaque_method_stubs(symbol_table);

if(ansi_c_entry_point(symbol_table, "main", get_message_handler()))
return true;

Expand Down
46 changes: 29 additions & 17 deletions src/ansi-c/expr2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,28 +518,40 @@ std::string expr2ct::convert_rec(
}
else if(src.id()==ID_symbol)
{
const typet &followed=ns.follow(src);
symbol_typet symbolic_type=to_symbol_type(src);
const irep_idt &typedef_identifer=symbolic_type.get(ID_typedef);

if(followed.id()==ID_struct)
// Providing we have a valid identifer, we can just use that rather than
// trying to find the concrete type
if(typedef_identifer!="")
{
std::string dest=q+"struct";
const irep_idt &tag=to_struct_type(followed).get_tag();
if(tag!="")
dest+=" "+id2string(tag);
dest+=d;
return dest;
return q+id2string(typedef_identifer)+d;
}
else if(followed.id()==ID_union)
else
{
std::string dest=q+"union";
const irep_idt &tag=to_union_type(followed).get_tag();
if(tag!="")
dest+=" "+id2string(tag);
dest+=d;
return dest;
const typet &followed=ns.follow(src);

if(followed.id()==ID_struct)
{
std::string dest=q+"struct";
const irep_idt &tag=to_struct_type(followed).get_tag();
if(tag!="")
dest+=" "+id2string(tag);
dest+=d;
return dest;
}
else if(followed.id()==ID_union)
{
std::string dest=q+"union";
const irep_idt &tag=to_union_type(followed).get_tag();
if(tag!="")
dest+=" "+id2string(tag);
dest+=d;
return dest;
}
else
return convert_rec(followed, new_qualifiers, declarator);
}
else
return convert_rec(followed, new_qualifiers, declarator);
}
else if(src.id()==ID_struct_tag)
{
Expand Down
Loading