Change the .ll syntax for comdats and add a syntactic sugar.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 6 Jan 2015 22:55:16 +0000 (22:55 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 6 Jan 2015 22:55:16 +0000 (22:55 +0000)
commit83a362cde8dda902ae516dbb1a721735a338abbb
tree6e0316b50f28fe0ba8628ada534b2cf4017799db
parented844c4ad1e403aff4eae0799eeccd21a3a36c90
Change the .ll syntax for comdats and add a syntactic sugar.

In order to make comdats always explicit in the IR, we decided to make
the syntax a bit more compact for the case of a GlobalObject in a
comdat with the same name.

Just dropping the $name causes problems for

@foo = globabl i32 0, comdat
$bar = comdat ...

and

declare void @foo() comdat
$bar = comdat ...

So the syntax is changed to

@g1 = globabl i32 0, comdat($c1)
@g2 = globabl i32 0, comdat

and

declare void @foo() comdat($c1)
declare void @foo() comdat

llvm-svn: 225302
40 files changed:
llvm/docs/LangRef.rst
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/AsmParser/LLParser.h
llvm/lib/IR/AsmWriter.cpp
llvm/test/Assembler/invalid-comdat.ll
llvm/test/Assembler/unnamed-comdat.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/coff-comdat.ll
llvm/test/CodeGen/X86/coff-comdat2.ll
llvm/test/CodeGen/X86/coff-comdat3.ll
llvm/test/CodeGen/X86/elf-comdat.ll
llvm/test/CodeGen/X86/elf-comdat2.ll
llvm/test/CodeGen/X86/macho-comdat.ll
llvm/test/Feature/comdat.ll
llvm/test/Instrumentation/AddressSanitizer/do-not-touch-comdat-global.ll
llvm/test/Linker/Inputs/comdat.ll
llvm/test/Linker/Inputs/comdat2.ll
llvm/test/Linker/Inputs/comdat3.ll
llvm/test/Linker/Inputs/comdat4.ll
llvm/test/Linker/Inputs/comdat5.ll
llvm/test/Linker/Inputs/comdat8.ll
llvm/test/Linker/Inputs/visibility.ll
llvm/test/Linker/comdat.ll
llvm/test/Linker/comdat2.ll
llvm/test/Linker/comdat3.ll
llvm/test/Linker/comdat4.ll
llvm/test/Linker/comdat5.ll
llvm/test/Linker/comdat6.ll
llvm/test/Linker/comdat7.ll
llvm/test/Linker/comdat8.ll
llvm/test/Linker/comdat9.ll
llvm/test/Linker/constructor-comdat.ll
llvm/test/Linker/visibility.ll
llvm/test/Transforms/GlobalDCE/pr20981.ll
llvm/test/Transforms/GlobalOpt/pr21191.ll
llvm/test/Transforms/GlobalOpt/preserve-comdats.ll
llvm/test/Transforms/Inline/pr21206.ll
llvm/test/Verifier/comdat.ll
llvm/test/Verifier/comdat2.ll
llvm/test/tools/gold/Inputs/comdat.ll
llvm/test/tools/gold/comdat.ll